Displaying os commands
Perochon Sebastien
Sebastien.Perochon at mmarelli-se.com
Tue May 25 12:26:38 EDT 2004
Thanks for all your answers.
I just wanted to know if python got a variable to enable/disable the output.
It seems not.
Thanks,
Sebastien.
-----Message d'origine-----
De: Dennis Lee Bieber [mailto:wlfraed at ix.netcom.com]
Date: mardi 25 mai 2004 18:03
À: python-list at python.org
Objet: Re: Displaying os commands
On Tue, 25 May 2004 15:57:41 +0200, "Fredrik Lundh"
<fredrik at pythonware.com> declaimed the following in comp.lang.python:
>
> the command is dir, not c:\dir.
>
I suspect that was supposed to be
c:\>dir
IE, the console prompt followed by the submitted command text.
> > How to display the launched command ?
>
> print command
> os.system(command)
>
If I'm right, the more complete code would be:
print "".join([os.getcwd(), ">", command])
os.system(command)
--
> ============================================================== <
> wlfraed at ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
> wulfraed at dm.net | Bestiaria Support Staff <
> ============================================================== <
> Home Page: <http://www.dm.net/~wulfraed/> <
> Overflow Page: <http://wlfraed.home.netcom.com/> <
--
http://mail.python.org/mailman/listinfo/python-list
More information about the Python-list
mailing list