What's wrong on using Popen's communicate method?

Chris Angelico rosuav at gmail.com
Fri Jul 5 22:47:45 EDT 2019


On Sat, Jul 6, 2019 at 12:31 PM <jfong at ms4.hinet.net> wrote:
>
> Terry Reedy於 2019年7月5日星期五 UTC+8上午12時13分25秒寫道:
> > On 7/3/2019 7:57 PM, jfong at ms4.hinet.net wrote:
> > > I have the test0.py below. I expect to see 'abcd' showing in the notepad window:
> > > ---------
> > > import subprocess as sp
> > > p0 = sp.Popen('notepad.exe', stdin=sp.PIPE)
> > > p0.communicate(input=b'abcd')
> > > ---------
> > > But nothing happens. The notepad is completely empty. What have I missed?
> > >
> > > --Jach
> > >
> > > PS. I am using python 3.4 on Windows Vista
> >
> > Upgrade to 3.7 or 3.8 to get hundreds of bug fixes, let alone new
> > features.  Both subprocess and multiprocessing have gotten fixes.
>
>     I can't because my OS is Vista and v3.4 is the last it can run:-( Also the pywin32 can't be installed for it requires v3.5 and up.
>

So... upgrade to a better operating system?

ChrisA



More information about the Python-list mailing list