Have you tried using the creationflags argument to subprocess.Popen?
Specially the CREATE_NEW_CONSOLE flag. See the Microsoft documentation
for CreateProcess athttp://msdn2.microsoft.com/en-us/library/ms682425(VS.85).aspx
(Note that a process can be attached at most to one console)
If your goal is to output some debug information, try using
OutputDebugString + the DebugView utility fromwww.sysinternals.com
One console per process is fine, but I tried using 'cmd.exe',
'cmd.exe /K', and 'more.com' (fully specified in c/windows/system32)
as separate processes. The sign is the console window splashes up and
vanishes right away.
0
------------------------Couple other symptoms.
'f.write' is not recognized as an internal or external command,
operable program or batch file.
f.write( b'abc' )
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Programs\Python\lib\io.py", line 1240, in write
s.__class__.__name__)
TypeError: can't write bytes to text streamf.write( 'abc' )
3
^Z
5000
09871234
------------------------
f.write('2'*2000) 2000
p= subprocess.Popen( 'c:\\windows\\system32\\more.com', stdin= f, creationfl ags= 16 )
p= subprocess.Popen( 'c:\\windows\\system32\\more.com', stdin= f, creationfl ags= 16 )
p= subprocess.Popen( 'c:\\windows\\system32\\more.com', stdin= f, creationfl ags= 16 )
p= subprocess.Popen( 'c:\\windows\\system32\\more.com', stdin= f, creationfl ags= 16 )
p= subprocess.Popen( 'c:\\windows\\system32\\more.com', stdin= f, creationfl ags= 16 )
p= subprocess.Popen( 'c:\\windows\\system32\\more.com', stdin= f, creationfl ags= 16 )
f= os.fdopen( q[0], 'a' )
p= subprocess.Popen( 'c:\\windows\\system32\\more.com', stdin= f, creationfl ags= 16 )
p= subprocess.Popen( 'c:\\windows\\system32\\more.com', stdin= f, creationfl ags= 16 )
f.read()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Programs\Python\lib\io.py", line 1378, in read
res += decoder.decode(self.buffer.read(), True)
File "C:\Programs\Python\lib\io.py", line 564, in read
self._unsupported("read")
File "C:\Programs\Python\lib\io.py", line 240, in _unsupported
(self.__class__.__name__, name))
io.UnsupportedOperation: BufferedWriter.read() not supportedTraceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Programs\Python\lib\io.py", line 1384, in read
readahead, pending = self._read_chunk()
File "C:\Programs\Python\lib\io.py", line 1277, in _read_chunk
readahead = self.buffer.read1(self._CHUNK_SIZE)
AttributeError: 'BufferedWriter' object has no attribute 'read1'Traceback (most recent call last):
ags=0 )
22222222222222222222222222222222222222222222222222222222222222222222222222222222
22222222222222222222222222222222222222222222222222222222222222222222222222222222
22222222222222222222222222222222222222222222222222222222222222222222222222222222
22222222222222222222222222222222222222222222222222222222222222222222222222222222
22222222222222222222222222222222222222222222222222222222222222222222222222222222
22222222222222222222222222222222222222222222222222222222222222222222222222222222