Re: How to run shell commands within python

2006-02-17 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Donn Cave wrote: You can replace mv with os.rename() if you don't care that it will fail when the destination is on a different filesystem. Etc. If you care than use `shutil.move()` instead. Ciao, Marc 'BlackJack' Rintsch --

How to run shell commands within python

2006-02-16 Thread fileexit
How can I execute shell commands from within python. Specifically, I am looking for something like the shell cat. But this also made me wonder how to execute shell commands anyway, just if i needed to do that in the future. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to run shell commands within python

2006-02-16 Thread Fredrik Lundh
fileexit wrote: thanks... i was to hasty to post this question, i found a good answer here: http://groups.google.com/group/comp.lang.python/browse_thread/thread/ffdab847125f81b6 that's an old thread, and Python has grown a few more ways to deal with shell commands since then. if os.system

Re: How to run shell commands within python

2006-02-16 Thread Juho Schultz
fileexit wrote: How can I execute shell commands from within python. Specifically, I am looking for something like the shell cat. But this also made me wonder how to execute shell commands anyway, just if i needed to do that in the future. You can use os.system() for that. --

Re: How to run shell commands within python

2006-02-16 Thread Szabolcs Nagy
use subprocess module from subprocess import call call(['cmd', 'arg1', 'arg2'], stdin='...', stdout='...') eg: call(['ls', '-l']) -- http://mail.python.org/mailman/listinfo/python-list

Re: How to run shell commands within python

2006-02-16 Thread Donn Cave
In article [EMAIL PROTECTED], Fredrik Lundh [EMAIL PROTECTED] wrote: (also note that most trivial shell commands are better done in python. most uses of cat, for example, can be trivially emulated with one or two lines of python...) Though the knowledge required to do this may be more

Re: How to run shell commands within python

2006-02-15 Thread limodou
On 15 Feb 2006 23:21:09 -0800, fileexit [EMAIL PROTECTED] wrote: How can I execute shell commands from within python. Specifically, I am looking for something like the shell cat. But this also made me wonder how to execute shell commands anyway, just if i needed to do that in the future.

Re: How to run shell commands within python

2006-02-15 Thread fileexit
thanks... i was to hasty to post this question, i found a good answer here: http://groups.google.com/group/comp.lang.python/browse_thread/thread/ffdab847125f81b6 -- http://mail.python.org/mailman/listinfo/python-list