Tomgu added the comment:
Here I get one problem need help.
In python 2.7.5 version I write a script test.py as below
###
import subprocess
fileID=file('test1.log','w')
process_response = subprocess.call('netsh wlan show\
interface',stdout=fileID,shell=True)
fileID.flush()
fileID.close()
###
It
Tomgu added the comment:
Update, the python version is '2.7.2 (default, Jun 12 2011, 15:08:59) [MSC
v.1500 32 bit (Intel)]'
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1124861
___
Daniel Serodio dsero...@gmail.com added the comment:
Ah, it works now. Thanks.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1124861
___
___
bairam bkom...@yahoo.com added the comment:
I have tested this form in Python26 ,It works
import subprocess
p = subprocess.Popen(cmd.exe dir, stdout=subprocess.PIPE)
p.communicate()
('Microsoft Windows XP [Version 5.1.2600]\r\n(C) Copyright 1985-2001 Microsoft
Corp.\r\n\r\nC:\\Python26',
Daniel Serodio dsero...@gmail.com added the comment:
Still doesn't work for me with Python 2.6.5 on Windows 7 64-bit, but apparently
for a different reason.
When I type p.communicate() as in bairam's example, it blocks with no output.
--
___
Python
bairam bkom...@yahoo.com added the comment:
shell vs subprocess
The problem is the default option Shell is False , you you write commands
you should turn on the shell.
for example try this to show the content of directory C:\Python26
:
import subprocess
p = subprocess.Popen(dir,
Daniel Serodio added the comment:
Is there any chance of having this fixed for 2.5.2 ?
_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1124861
_
___
Python-bugs-list
Andrew Trusty added the comment:
I agree with Daniel, I think this bug or a variant is still present in
2.5.1 because my wxPython app on Windows XP would fail to execute a
Popen with only stdout using PIPE but succeeded with the described
workaround of having stdout, stderr, and stdin set to
Daniel Serodio added the comment:
I found this bug via this post:
http://mail.python.org/pipermail/python-list/2007-April/436275.html
And I think 2.5.1 still has this bug. I'm not familiar with Python
bugtracker's ettiquete, should I reopen this bug?
--
nosy: +dserodio