Displaying os commands

Larry Bates lbates at swamisoft.com
Tue May 25 10:15:51 EDT 2004


Try:

import os
cmd=r"dir"
cwd=os.getcwd()
print "%s>%s" % (cwd, cmd)
os.system(cmd)

Larry Bates,
Syscon, Inc.
"Perochon Sebastien" <Sebastien.Perochon at mmarelli-se.com> wrote in message
news:mailman.268.1085493093.6949.python-list at python.org...
>   Hi all,
>
> When I do (on Windows):
>
> os.system('dir')
>
> The command 'dir' is well executed but the command itself 'c:\dir' is not
> displayed.
> How to display the launched command ?
>
> Thanks,
> Sebastien
>
>





More information about the Python-list mailing list