[Tutor] Re: changing sys.stdin to accept keyboard input

Prahlad Vaidyanathan slime@vsnl.net
Tue, 5 Mar 2002 08:06:18 +0530


Hi,

On Sun, 03 Mar 2002 Kalle Svensson spewed into the ether:
[-- snippity --]
> I guess this is OS dependent (and more), but on my GNU/Linux
> workstation this seems to work:
> 
> import sys
> print sys.stdin.read()
> sys.stdin = open("/dev/tty")
> print raw_input("Number: ")

I've got Debian here, so this works OK. Thanks !

pv.
-- 
Prahlad Vaidyanathan  <http://www.symonds.net/~prahladv/>

"Cogito ergo I'm right and you're wrong."
		-- Blair Houghton