use lines as argument to a command

Shoryuken sakradevanamindra at gmail.com
Mon Oct 15 23:55:45 EDT 2007


> I guess that you want to loop over a file and for each line in the
> file you want to call some
> external program with the line as the argument.
>
> Have a look at subprocess module
>  http://docs.python.org/lib/module-subprocess.html
>
> If there is some else that you meant, please specify .
>
> Cheers,
>
> --
> --
> Amit Khemka

Thanks alot, its working now. But I have another question (sorry I'm
so noob), how can I redirect a command's output to a file (just like
executing a linux command "dmesg>>stat.txt")?





More information about the Python-list mailing list