[python-win32] executing dos commands

Graeme Glass graemeglass at gmail.com
Fri Mar 6 13:07:36 CET 2009


On Fri, Mar 6, 2009 at 1:29 PM, <Solomon.Zewdie.Altek at zf.com> wrote:
>
> Hi folkz,
> just a simple question for a python guru:-)
>
> How can I execute dos commands via python?
> The command exec("chdir \Dir1\dir2\..") doesn't do it.
>
> Many thanks in advance!
>
> Solomon
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32


Hi Solomon,
I think you are looking for either os.system(command) or the subprocess module.

Take a look at http://docs.python.org, very comprehensive and a great
helpful tutorial.
HTH

Graeme


More information about the python-win32 mailing list