running actual unix commands

Ian Bicking ianb at colorstudy.com
Wed May 28 01:59:28 EDT 2003


On Wed, 2003-05-28 at 00:37, Andrew Thomson wrote:
> not sure if this is the best way, but i'm attempting the following:
> 
> cmd = "find " + dir + " " + "-type f -name \"*.ajt\" -amin +" + time + "
> " + "| wc -l | awk \'{print $1}\'"
> files = os.system(cmd)
> print files

output = os.popen(command)
files = [fn.strip() for fn in output.readlines()]

There are several versions of the os.popen command, the module
documentation for os will tell you more.

  Ian







More information about the Python-list mailing list