[BangPypers] how to override sys.stdin

Rohit Chormale rohitchormale at gmail.com
Mon Aug 4 12:26:30 CEST 2014


It might work,

sys.stdin = open(sys.stdin.fileno(), 'r', <Data descriptors>)

or

Simply for replacing iostream,

sys.stdin = open(<filepath> ,'r')


On Mon, Aug 4, 2014 at 3:48 PM, Rohit Chormale <rohitchormale at gmail.com>
wrote:

>
> Hi Nitin,
>
> Do u mean redirecting Standard IO streams?
>
>
> On Mon, Aug 4, 2014 at 3:08 PM, Noufal Ibrahim KV <noufal at nibrahim.net.in>
> wrote:
>
>> On Mon, Aug 04 2014, Nitin Kumar wrote:
>>
>> > thats a typo error.
>> >
>> > in simple term my question would be: How to override sys.stdin.
>>
>> [...]
>>
>> The StringIO module gives you file like objects into which you can put
>> data. They might work as substitues for sys.std*
>>
>> --
>> Cordially,
>> Noufal
>> http://nibrahim.net.in
>> _______________________________________________
>> BangPypers mailing list
>> BangPypers at python.org
>> https://mail.python.org/mailman/listinfo/bangpypers
>>
>
>


More information about the BangPypers mailing list