"shell-commands" and python!

Frédéric Laurent listenospam at opikanoba.org
Fri Sep 21 03:51:45 EDT 2001


Hi

to execute ls, import the os module

Python 2.1 (#1, Apr 17 2001, 09:45:01)
[GCC 2.95.3-2 (cygwin special)] on cygwin_nt-4.01
Type "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system("ls")
about.html  api   doc  icons       inst  mac            ref
acks.html   dist  ext  index.html  lib   modindex.html  tut
0
>>>

you don't think it's vey simple ?


"Mike S" <mikael at actro.com> a écrit dans le message news:
9oeqks$8t0$1 at zingo.tninet.se...
> hey there!
>
> how do I execute "shellcommands" in python???
> do I need to use the os module and the system command?
>
> Is there any simplier way to do it??
>
> /Mike

--
Fréderic Laurent
remove nospam from email address






More information about the Python-list mailing list