Reading From stdin After Command Line Redirection

Tim Daneliuk tundra at tundraware.com
Wed Oct 23 13:25:09 EDT 2013


I have a program that runs like this:

   foo.py <inputfile

I want to reconnect stdin to the tty as usual after 'inputfile'
has been read so that things like raw_input and getpass
will work as expected.

So, after I do .... = sys.stdin.readlines(), how to I reopen
stdin in its nonredirected mode?
-- 
-----------------------------------------------------------------------
Tim Daneliuk



More information about the Python-list mailing list