Opening standard IO as a stream

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jul 2009
Posts: 31
Reputation: tdeck is an unknown quantity at this point 
Solved Threads: 0
tdeck tdeck is offline Offline
Light Poster

Opening standard IO as a stream

 
0
  #1
Aug 4th, 2009
I'm wondering if there's a way to open standard I/O as a stream, so I can write and read character by character. Something like
  1. handle = open(stdio)
Any ideas?
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,054
Reputation: jlm699 is a jewel in the rough jlm699 is a jewel in the rough jlm699 is a jewel in the rough jlm699 is a jewel in the rough 
Solved Threads: 265
Sponsor
jlm699's Avatar
jlm699 jlm699 is offline Offline
Knows where his Towel is

Re: Opening standard IO as a stream

 
1
  #2
Aug 4th, 2009
sys.stdin is an "always open" file handle to the stdin and likewise sys.stdout. To use them, import sys.
1. Use Code Tags.
2. Homework? Show Effort.
3. Keep discussions on the forum: no PMs
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC