reusing sys.stdin?

Graham Guttocks graham_guttocks at yahoo.co.nz
Thu Apr 12 20:28:32 EDT 2001


Greetings,

Something I don't understand.  In my program I need to access
sys.stdin from two different functions in the following manner:

   import rfc822,sys
   message_headers = rfc822.Message(sys.stdin)

The problem is that after the first Message instance is created,
sys.stdin seems to be absorbed so that it is no longer around for the
second call to rfc822.Message().  Why is this, and is there a way to
keep sys.stdin for disappearing so I can use it a second time?

Regards,
Graham

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/




More information about the Python-list mailing list