By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,940 Members | 1,328 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,940 IT Pros & Developers. It's quick & easy.

Non blocking read from stdin on windows.

P: n/a
Hi
Can any one help.

I am trying to write a python scipt that takes input as args and/or as piped
input ( possibly the output of another program).

I want to read stdin ( the piped in stuuff ) whcih might be empty without
the script blocking if it is empty.

I understand it is possible to do under unix with the select call. Can some
one please explain how to do this in windows.

thanks in advance.

Barr

Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You can always have a thread which continually reads stdin and stores it
in a string, or better, in a cStringIO.StringIO object. Then in the main
thread, you can check whether something new has arrived. This, of course
will work on all platforms.

I hope this helped a bit,
Noam
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.