"Sara Khalatbari" <sa************@yahoo.com> wrote in message
news:ma**************************************@pyth on.org...
There are a lot of commands that I need to use in my
code & I don't know how to do it
Is there a way to use shell commands in Python code?
Yes, there are many popen() forms that you may wish to investigate. Below
is a brief clip. However, if you can find the functionality already built
into Python, such as globbing filenames, that would be better. It will be
more portable to more systems and probably faster.
x = os.popen("ls -al")
for aline in x.readlines():
print aline,