Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #57374

Reading From stdin After Command Line Redirection

From Tim Daneliuk <tundra@tundraware.com>
Newsgroups comp.lang.python
Subject Reading From stdin After Command Line Redirection
Date 2013-10-23 12:25 -0500
Organization TundraWare Inc.
Message-ID <7cdlja-j3j2.ln1@ozzie.tundraware.com> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Reading From stdin After Command Line Redirection Tim Daneliuk <tundra@tundraware.com> - 2013-10-23 12:25 -0500
  Re: Reading From stdin After Command Line Redirection Chris Angelico <rosuav@gmail.com> - 2013-10-24 07:40 +1100
  Re: Reading From stdin After Command Line Redirection Ben Finney <ben+python@benfinney.id.au> - 2013-10-24 07:46 +1100
  Re: Reading From stdin After Command Line Redirection Chris Angelico <rosuav@gmail.com> - 2013-10-24 07:52 +1100
  Re: Reading From stdin After Command Line Redirection random832@fastmail.us - 2013-10-23 17:01 -0400
  Re: Reading From stdin After Command Line Redirection Ben Finney <ben+python@benfinney.id.au> - 2013-10-24 09:20 +1100
    Re: Reading From stdin After Command Line Redirection Tim Daneliuk <tundra@tundraware.com> - 2013-10-23 19:09 -0500
      Re: Reading From stdin After Command Line Redirection Ben Finney <ben+python@benfinney.id.au> - 2013-10-24 14:53 +1100
        Re: Reading From stdin After Command Line Redirection Tim Daneliuk <tundra@tundraware.com> - 2013-10-23 23:36 -0500
        Re: Reading From stdin After Command Line Redirection Tim Daneliuk <tundra@tundraware.com> - 2013-10-23 23:39 -0500
        Re: Reading From stdin After Command Line Redirection Ben Finney <ben+python@benfinney.id.au> - 2013-10-24 15:54 +1100
          Re: Reading From stdin After Command Line Redirection Tim Daneliuk <tundra@tundraware.com> - 2013-10-24 06:58 -0500
          Re: Reading From stdin After Command Line Redirection Tim Daneliuk <tundra@tundraware.com> - 2013-10-24 06:58 -0500
            Re: Reading From stdin After Command Line Redirection Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-10-24 13:10 +0100
              Re: Reading From stdin After Command Line Redirection Tim Daneliuk <tundra@tundraware.com> - 2013-10-24 08:41 -0500
                Re: Reading From stdin After Command Line Redirection feedthetroll@gmx.de - 2013-10-24 07:36 -0700
                Re: Reading From stdin After Command Line Redirection Tim Daneliuk <tundra@tundraware.com> - 2013-10-24 09:43 -0500
              Re: Reading From stdin After Command Line Redirection Tim Daneliuk <tundra@tundraware.com> - 2013-10-24 08:41 -0500
                Re: Reading From stdin After Command Line Redirection Ethan Furman <ethan@stoneleaf.us> - 2013-10-24 07:30 -0700
      Re: Reading From stdin After Command Line Redirection Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-24 09:14 +0100
      Re: Reading From stdin After Command Line Redirection Ben Finney <ben+python@benfinney.id.au> - 2013-10-24 19:43 +1100
      Re: Reading From stdin After Command Line Redirection Tim Chase <python.list@tim.thechases.com> - 2013-10-24 05:45 -0500
      Re: Reading From stdin After Command Line Redirection Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-10-24 12:33 +0100
      Re: Reading From stdin After Command Line Redirection Ethan Furman <ethan@stoneleaf.us> - 2013-10-24 07:39 -0700
    Re: Reading From stdin After Command Line Redirection Tim Daneliuk <tundra@tundraware.com> - 2013-10-23 19:09 -0500
  Re: Reading From stdin After Command Line Redirection Chris Angelico <rosuav@gmail.com> - 2013-10-24 09:23 +1100

csiph-web