Sunday, 27 October 2019

python script hangs when writing to /dev/xconsole

my python script is supposed to write to /dev/xconsole. It works as expected, when I am reading from /dev/xconsole, such as with tail -F /dev/xconsole. But if I don't have tail running, my script hangs and waits.

I am opening the file as follows:

xconsole = open('/dev/xconsole', 'w')

and writing to it:

for line in sys.stdin:
    xconsole.write(line)

Why does my script hang, when nobody is reading the output from /dev/xconsole ?



from python script hangs when writing to /dev/xconsole

No comments:

Post a Comment