How to execute a command line in a Python program?

Joerg Woelke dvass at felis.uni-freiburg.de
Sun Nov 10 03:13:25 EST 2002


Mindy wrote:
> 
> Hey, in my python program, I want to call another
> program or command, say, emacs filename&, how to get
> to this? I found there's execfile() function in
> Python? Do I need to write a shell program which calls
> "exec emacs filename&" and then, in my python progam,
> use execfile to execute this shell program? Is there
> any simple way?

Yes, os.system("emacs %s &" %filename)
 
> Thanks!

HTH, J"o!

-- 
sigfault



More information about the Python-list mailing list