Re: don't understand popen2

2006-03-24 Thread Kent Johnson
Sion Arrowsmith wrote: > Kent Johnson <[EMAIL PROTECTED]> wrote: > >>Sion Arrowsmith wrote: >> >>>(and please avoid the abuse of raw strings for Windows paths). >> >>Why do you consider that abuse of raw strings? > > I consider it abuse because it's not what they were invented for. > I consider

Re: don't understand popen2

2006-03-24 Thread Sion Arrowsmith
Kent Johnson <[EMAIL PROTECTED]> wrote: >Sion Arrowsmith wrote: >> (and please avoid the abuse of raw strings for Windows paths). >Why do you consider that abuse of raw strings? I consider it abuse because it's not what they were invented for. I consider discouraging it to be a good thing in orde

Re: don't understand popen2

2006-03-23 Thread Kent Johnson
Sion Arrowsmith wrote: > Try: > std_out, std_in = popen2.popen2("F:/coding/pwSync/popen_test/testia.py") > or: > std_out, std_in = popen2.popen2("F:\\coding\\pwSync\\popen_test\\testia.py") > (and please avoid the abuse of raw strings for Windows paths). Why do you consider that abuse of raw strin

Re: don't understand popen2

2006-03-23 Thread Fredrik Lundh
Sion Arrowsmith wrote: "F:\coding\pwSync\popen_test\testia.py" > 'F:\\coding\\pwSync\\popen_test\testia.py' this might make it more obvious that something's not quite right with that string literal: >>> print "F:\coding\pwSync\popen_test\testia.py" F:\coding\pwSync\popen_test es

Re: don't understand popen2

2006-03-23 Thread Sion Arrowsmith
Martin P. Hellwig <[EMAIL PROTECTED]> wrote: >std_out, std_in = popen2.popen2("F:\coding\pwSync\popen_test\testia.py") ^^ Your problem is, I suspect, nothing to do with popen2(), which is supported by the fact that the only thing other th

Re: don't understand popen2

2006-03-23 Thread Martin P. Hellwig
Donn Cave wrote: > > Anyway, it seems unlikely he would get that INVARG error for this > reason. That's an error from the host operating system, not the > interpreter, and it mostly likely refers to the file descriptor. > Since it works for me, I guess his problem is basically this: > > |> (pyt

Re: don't understand popen2

2006-03-22 Thread Martin P. Hellwig
gry@ll.mit.edu wrote: > > You gave it a single string, not a list(sequence) of strings. Try > something like: > std_in.writelines(["notgood"]) > I got this output then: >>> something: Traceback (most recent call last): File "F:\coding\pwSync\popen_test\popen_test.py", line 8, in ?

Re: don't understand popen2

2006-03-22 Thread Donn Cave
Quoth gry@ll.mit.edu: | Martin P. Hellwig wrote: ... |> import popen2 |> |> std_out, std_in = popen2.popen2("testia.py") |> |> x=std_out.readline() |> print(x) |> |> std_in.writelines("notgood") |> |> x=std_out.readline() |> print(x) ... |> Traceback (most recent call last): |>File "F:\coding\p

Re: don't understand popen2

2006-03-22 Thread gry
Martin P. Hellwig wrote: > Hi all, > > I was doing some popen2 tests so that I'm more comfortable using it. > I wrote a little python script to help me test that (testia.py): > > - > someline = raw_input("something:") > > if someline == 'test': > print("yup") >