LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-03-2005, 03:10 PM   #1
randomx
Member
 
Registered: Feb 2003
Location: Hawaii
Distribution: Debian
Posts: 130

Rep: Reputation: 16
python os.system arguments


I got the following function defined. Toy example below.

Code:
def movieWatch():
    movie = raw_input('Randomx, What movie do you want to watch? : ')
     os.system ('mplayer ' ,movie)
I get the following error:

os.system ('mplayer ' ,movie)
TypeError: system() takes exactly 1 argument (2 given)

I also tried...

Code:
os.system ('mplayer movie')
Is there any workaround for that so system takes 2 arguments? Any additional ideas on how to do it?

thanks,
Randomx
 
Old 03-03-2005, 03:21 PM   #2
linuxzealot
Member
 
Registered: Feb 2005
Distribution: Gentoo
Posts: 57

Rep: Reputation: 15
Im no python programmer, but could you do something similiar to this in python

var = "mplayer" + movie_name
os.system(var)
 
Old 03-03-2005, 03:54 PM   #3
randomx
Member
 
Registered: Feb 2003
Location: Hawaii
Distribution: Debian
Posts: 130

Original Poster
Rep: Reputation: 16
I feel sooo dumb right now....

thanks bro..you are absolutely right. That's the way you do it...

randomx
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unmerged python in gentoo system! ascentsoft Gentoo 5 11-02-2008 04:12 PM
Fedora System-Python gone :( Xiiph Linux - Software 1 04-02-2005 02:49 PM
How to import arguments to system() function skie_knite007 Programming 5 03-25-2005 08:49 PM
python alternative to os.system() datadriven Programming 5 02-27-2005 07:57 AM
Python function arguments are dictionaries? johnMG Programming 1 07-24-2004 06:29 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration