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 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
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
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.
--
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
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
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.
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