Pair of filenos read/write each other?

Antoine Pitrou solipsis at pitrou.net
Thu Aug 15 14:24:05 EDT 2013


Jack Bates <tdhfwh <at> nottheoilrig.com> writes:
> > 
> > An alternative is to use multiprocessing.Pipe():
> > http://docs.python.org/3.3/library/multiprocessing.html#multiprocessing.Pipe
> > 
> > In any case, Python doesn't lack facilities for doing what you want.
> 
> Thank you for your help, I need to satisfy an interface that requires a single
> file descriptor number that can be both read from and written to. Is it
> possible with any of the solutions you pointed out to get a single file
> descriptor number for each end?

Yes, it is what multiprocessing.Pipe() provides:
http://docs.python.org/3.3/library/multiprocessing.html#multiprocessing.Connection.fileno

Regards

Antoine.





More information about the Python-list mailing list