I got a loop like this:

     while True:
         line = sys.stdin.readline()
         if not line:
             break
         line = line.rstrip()
         log_message(options.channel_name, line)
         print line

this loop will read text if I execute it from a command prompt like this:

dir | python.exe log.py

however, since I've set PATHEXT to contain .PY, I tried this:

dir | log.py

which ended up with the loop just skipping.

Does anyone know how to fix this problem ? Being able to use PATHEXT 
execution (just execute python file directly) and still being able to 
grab stdin? I assume that since there is some magic involved in invoking 
python.exe here, stdin gets munged on the way.

-- 
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to