Help replacing os.system call with subprocess call

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Apr 7 15:58:04 CEST 2008


>> David Pratt wrote:
>>> Hi. I am trying to replace a system call with a subprocess call. I have
>>> tried subprocess.Popen and subprocess.call with but have not been
>>> successful. The command line would be:
>>>
>>> svnadmin dump /my/repository > svndump.db

En Mon, 07 Apr 2008 10:38:47 -0300, David Pratt <fairwinds at eastlink.ca>  
escribió:

> The speed of this solution is slower than os.system. Would a queue of
> some kind be needed to speed this up? Has anyone implemented something
> like this? Many thanks.

See the last post from Matt Nordhoff, where he calls Popen with  
stdout=an_open_file. This is the direct translation of ">outfile" in a  
shell, and faster because it doesn't involve Python processing.

-- 
Gabriel Genellina




More information about the Python-list mailing list