popen3 and Perforce
Sam Holden
sholden at flexal.cs.usyd.edu.au
Thu Sep 9 05:11:10 EDT 2004
On 8 Sep 2004 22:28:11 -0700, Ruchika <ruchika_khera at hotmail.com> wrote:
> Hi,
>
> I am trying to automate the build process for which I need to run P4
> commands from the Python script. After getting sources from Perforce,
> I need to build them using Visual C++ from the script.
> I wrote a small script that calls the P4 sync command from the script
> -
>
> try:
> in, out, err = os.popen3('P4 -s sync -f /dev/src/...')
> x = len (in.readlines())
> y = len (out.readlines())
> z = len (err.readlines())
> print x
> print y
> print z
> except IOError:
> print "IOError"
> except:
> print "Unknown"
>
> Tha above returns from os.opopen3 almost immediately, goes to x = len
> (in.readlines()) and then jumps to the IOError exception.
> Can anyone help me figure out whats happening.
Reading from an output only filehandle is probably doomed to fail.
--
Sam Holden
More information about the Python-list
mailing list