Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'satisfy': 0.09; 'python': 0.11; 'descriptor': 0.16; 'from:addr:pitrou.net': 0.16; 'from:addr:solipsis': 0.16; 'from:name:antoine pitrou': 0.16; 'message-id:@post.gmane.org': 0.16; 'received:213.41.240': 0.16; 'received:213.41.240.54': 0.16; 'received:80.91.229.3': 0.16; 'received:charlus.yi.org': 0.16; 'received:plane.gmane.org': 0.16; 'received:yi.org': 0.16; 'pointed': 0.19; 'written': 0.21; 'header :User-Agent:1': 0.23; 'subject:/': 0.26; 'header:X-Complaints- To:1': 0.27; "doesn't": 0.30; 'subject:other': 0.31; 'writes:': 0.31; 'file': 0.32; 'interface': 0.32; 'url:python': 0.33; 'case,': 0.35; 'doing': 0.36; 'charset:us-ascii': 0.36; 'possible': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'thank': 0.38; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'help,': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'read': 0.60; 'url:3': 0.61; 'skip:n 10': 0.64; 'facilities': 0.69; 'lack': 0.78; 'antoine.': 0.84; 'subject:read': 0.84; 'subject:Pair': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Antoine Pitrou Subject: Re: Pair of filenos read/write each other? Date: Thu, 15 Aug 2013 18:24:05 +0000 (UTC) References: <20130815161937.GA6494@kolibri> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 213.41.240.54 (Mozilla/5.0 (X11; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1376591064 news.xs4all.nl 15903 [2001:888:2000:d::a6]:60866 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52564 Jack Bates 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.