what does "python -i" use as input stream (stdin)?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Oct 2 01:43:56 EDT 2008


En Wed, 01 Oct 2008 14:48:52 -0300, Almar Klein <almar.klein at gmail.com>  
escribió:

> I wanted to give your solution a try, but got stuck.
> The file that I want to replace the "standard input" with is a pseudo  
> file
> object with a custom read method. I have a hard time finding out how
> to have a file descriptor (or fileno) associated with it.
>
> I tried inheriting from the "file" class (using a dummy file on disk),  
> and
> then
> overriding the read() and __init__() method. To test I used
> os.read(my_file_no,1),
> but it reads the contents of my dummy file rather than using my read  
> method.
> So obviously it does some low level stuff there...

I did not understand completely what you want, and rereading previous  
posts I got even more confused...
Could you provide a complete description of what you want to do?
Is it a single process, or two separate processes? Running on the same  
machine or remotely? All python or there is another program involved?

-- 
Gabriel Genellina




More information about the Python-list mailing list