matplotlib-0.87.2 on Windows - using subprocess.Popen()

Darren,

I prefer using PythonWin to IDLE. Any ideas how to solve the
subprocess.Popen() problem using PythonWin? What about using
"win32pipe"?

PJR

···

-----Original Message-----
From: Darren Dale [mailto:dd55@…163…]
Sent: 20 March 2006 15:52
To: Randewijk P-J <pjrandew@…841…>
Subject: Re: ASPN : Python Cookbook : Module to allow Asynchronous
subprocess use on Windows and Posix platforms

I forgot to mention, you may be able to avoid these errors by starting
idle
with the -n flag.

On Monday 20 March 2006 08:36, you wrote:

Aha!

In both the IDLE & PythonWin (my default my using pylab) shells it
fails... but not from the python shell...

PJR

> -----Original Message-----
> From: Darren Dale [mailto:dd55@…163…]
> Sent: 20 March 2006 15:25
> To: Randewijk P-J <pjrandew@…841…>
> Subject: Re: ASPN : Python Cookbook : Module to allow Asynchronous
> subprocess use on Windows and Posix platforms
>
>
> Also, are you running this from IDLE? If so, please try running it
> from a regular python shell, or better, run a script from the dos
> shell.
>
> On Monday 20 March 2006 08:06, you wrote:
> > This is what I get:
> > >>> import subprocess
> > >>> process = subprocess.Popen(['dir'], shell=True,
> >
> > stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
> > Traceback (most recent call last):
> > File "<interactive input>", line 1, in ?
> > File "C:\Python\lib\subprocess.py", line 533, in __init__
> > (p2cread, p2cwrite,
> > File "C:\Python\lib\subprocess.py", line 593, in _get_handles
> > p2cread = self._make_inheritable(p2cread)
> > File "C:\Python\lib\subprocess.py", line 634, in

_make_inheritable

> > DUPLICATE_SAME_ACCESS)
> > TypeError: an integer is required
> >
> > PJR
> >
> > > -----Original Message-----
> > > From: Darren Dale [mailto:dd55@…163…]
> > > Sent: 20 March 2006 14:49
> > > To: Randewijk P-J <pjrandew@…841…>
> > > Subject: Re: ASPN : Python Cookbook : Module to allow
>
> Asynchronous
>
> > > subprocess use on Windows and Posix platforms
> > >
> > >
> > > Hi P-J,
> > >
> > > On Monday 20 March 2006 7:39 am, you wrote:
> > > > Dear Darren,
> > > >
> > > > Maybe this could help solve the Windows problem with
> > >
> > > Popen()… don't
> > >
> > > > know about the 2.3 issue however…
> > > >
> > > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554
> > >
> > > I'm not convinced that there is an issue with subprocess.Popen
> > > in windows. I tested the following block on windows (with
>
> python-2.4)
>
> > > and it worked fine.
> > >
> > > import subprocess
> > > process = subprocess.Popen(['dir'], shell=True,
> > > stdout=subprocess.PIPE,
> > > stderr=subprocess.STDOUT)
> > > stat = process.wait()
> > > print process.stdout.read()
> > >
> > > I posted this to the list last week. Did you test it?
>
> –
> Darren S. Dale, Ph.D.
> Cornell High Energy Synchrotron Source
> Cornell University
> 200L Wilson Lab
> Rt. 366 & Pine Tree Road
> Ithaca, NY 14853
>
> dd55@…163…
> office: (607) 255-9894
> fax: (607) 255-9001

--
Darren S. Dale, Ph.D.
Cornell High Energy Synchrotron Source
Cornell University
200L Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853

dd55@...163...
office: (607) 255-9894
fax: (607) 255-9001

Darren,

I prefer using PythonWin to IDLE. Any ideas how to solve the
subprocess.Popen() problem using PythonWin? What about using
"win32pipe"?

I don't know how to solve it for pythonwin, maybe you could investigate it
with a google search (thats how I learned about the problem and the solution
for idle).

I suppose win32pipe is part of pywin32. If that is the case, I dont think I
can support using it; we are trying to eliminate dependencies, not add to
them. Subprocess is acceptable because it is part of the python-2.4 standard
library and we were able to add it to the mpl tree for older versions of
python.

Darren

···

On Monday 20 March 2006 09:03, Randewijk P-J <pjrandew@...841...> wrote:

-----Original Message-----
From: Darren Dale [mailto:dd55@…163…]
Sent: 20 March 2006 15:52
To: Randewijk P-J <pjrandew@…841…>
Subject: Re: ASPN : Python Cookbook : Module to allow Asynchronous
subprocess use on Windows and Posix platforms

I forgot to mention, you may be able to avoid these errors by starting
idle
with the -n flag.

On Monday 20 March 2006 08:36, you wrote:
> Aha!
>
> In both the IDLE & PythonWin (my default my using pylab) shells it
> fails… but not from the python shell…
>
> PJR
>
> > -----Original Message-----
> > From: Darren Dale [mailto:dd55@…163…]
> > Sent: 20 March 2006 15:25
> > To: Randewijk P-J <pjrandew@…841…>
> > Subject: Re: ASPN : Python Cookbook : Module to allow Asynchronous
> > subprocess use on Windows and Posix platforms
> >
> >
> > Also, are you running this from IDLE? If so, please try running it
> > from a regular python shell, or better, run a script from the dos
> > shell.
> >
> > On Monday 20 March 2006 08:06, you wrote:
> > > This is what I get:
> > > >>> import subprocess
> > > >>> process = subprocess.Popen(['dir'], shell=True,
> > >
> > > stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
> > > Traceback (most recent call last):
> > > File "<interactive input>", line 1, in ?
> > > File "C:\Python\lib\subprocess.py", line 533, in __init__
> > > (p2cread, p2cwrite,
> > > File "C:\Python\lib\subprocess.py", line 593, in _get_handles
> > > p2cread = self._make_inheritable(p2cread)
> > > File "C:\Python\lib\subprocess.py", line 634, in

_make_inheritable

> > > DUPLICATE_SAME_ACCESS)
> > > TypeError: an integer is required
> > >
> > > PJR
> > >
> > > > -----Original Message-----
> > > > From: Darren Dale [mailto:dd55@…163…]
> > > > Sent: 20 March 2006 14:49
> > > > To: Randewijk P-J <pjrandew@…841…>
> > > > Subject: Re: ASPN : Python Cookbook : Module to allow
> >
> > Asynchronous
> >
> > > > subprocess use on Windows and Posix platforms
> > > >
> > > >
> > > > Hi P-J,
> > > >
> > > > On Monday 20 March 2006 7:39 am, you wrote:
> > > > > Dear Darren,
> > > > >
> > > > > Maybe this could help solve the Windows problem with
> > > >
> > > > Popen()… don't
> > > >
> > > > > know about the 2.3 issue however…
> > > > >
> > > > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554
> > > >
> > > > I'm not convinced that there is an issue with subprocess.Popen
> > > > in windows. I tested the following block on windows (with
> >
> > python-2.4)
> >
> > > > and it worked fine.
> > > >
> > > > import subprocess
> > > > process = subprocess.Popen(['dir'], shell=True,
> > > > stdout=subprocess.PIPE,
> > > > stderr=subprocess.STDOUT)
> > > > stat = process.wait()
> > > > print process.stdout.read()
> > > >
> > > > I posted this to the list last week. Did you test it?
> >
> > –
> > Darren S. Dale, Ph.D.
> > Cornell High Energy Synchrotron Source
> > Cornell University
> > 200L Wilson Lab
> > Rt. 366 & Pine Tree Road
> > Ithaca, NY 14853
> >
> > dd55@…163…
> > office: (607) 255-9894
> > fax: (607) 255-9001

--
Darren S. Dale, Ph.D.
Cornell High Energy Synchrotron Source
Cornell University
200L Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853

dd55@...163...
office: (607) 255-9894
fax: (607) 255-9001