redirecting Stdin

Erik Max Francis max at alcyone.com
Wed Dec 3 04:54:11 EST 2003


Jon Arter wrote:

> Is is Possible to redirect the Python stdin in order to receive stdin
> commands from a file ?
> The time of redirection can  last until exiting the Python  and should
> be transparent for python it self.

Sure:

	sys.stdin = file('newinput')

-- 
   Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ 
\__/ The map is not the territory.
    -- Alfred Korzybski




More information about the Python-list mailing list