[python-win32] os.popen/winpipe

Jürgen Kareta python at kareta.de
Thu Nov 18 16:10:04 CET 2004


Hello,

I am wondering about the following code pices:
Nt04 python 2.3.3 pywin 203

[code 1] 
import win32pipe
f = win32pipe.popen('dir ch*')
print f.read()
f.close()

result ok

[code 2]
import win32pipe
f = win32pipe.popen('net use')
print f.read()
f.close()

result ok

[code 3]
import win32pipe
f = win32pipe.popen('net use lpt2: \\server\printer') ##or 'net use ?'
print f.read()
f.close()

empty result string

If I send the 'dir' command with or without parameters I get a result string,
same as 'net use' command without parameters, but 'net use' with parameters fire
allways a empty resutlt string. Any hints ?

Thanks in advance!
regards,
Jürgen


More information about the Python-win32 mailing list