popen

March 10th, 2008 by webstersprodigy

Running shell commands and capturing input within python

This is something I have to do all the time.

something like:

import os
text = os.popen(‘ls’).read()
print text

will do it.  Another handy tool is the os.system call.

Leave a Reply


No computers were harmed in the 0.168 seconds it took to produce this page.