AndyL wrote:
> Hi,
>
> What would by a python equivalent of following shell program:
>
>       #!/bin/sh
>
>       prog1 > file1 &
>       prog2 > file2 &
>
>
> As you see, I need to spawn a few processes and redirect stdout to some
> files.

For example :

------------------cut here-------------------------------
#!/usr/bin/env python

import os

# 1-st variant

os.system("prog1 > tmp1.txt &")

# or 2-nd variant

os.popen("prog1 > tmp2.txt &")
---------------cut here-------------------------------------

Regards,
Rob

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to