als testcode habe ich mal einen code von http://my.opera.com/zomg/blog/2007/0...nd-named-pipes genommen:
Code: Alles auswählen
import os
# the name of the pipe
pipeName = 'testpipe'
# we will get an error if the pipe exists
# when creating a new one, so try removing it first
try:
os.unlink(pipeName)
except:
pass
# create the pipe and open it for reading
os.mkfifo(pipeName)
pipe = open(pipeName,'r')
# read forever and print anything written to the pipe
while True:
data = pipe.readline()
if data != '':
print repr(data)
zum start gebe ich einfach "python pipe.py" ein und das Programm bleibt genau beim open befehl stehen und macht nichts mehr und lässt sich nur mit CTR-C beenden:
Code: Alles auswählen
$ python pipe.py
Traceback (most recent call last):
File "pipe.py", line 15, in <module>
pipe = open(pipeName,'r')