Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; '3.2': 0.05; 'bits': 0.07; 'python': 0.08; '>>>': 0.12; 'server,': 0.12; 'library': 0.15; 'dst)': 0.16; 'guys,': 0.16; 'shutil': 0.16; 'stumbled': 0.16; 'skip:m 30': 0.21; 'directory.': 0.23; 'function': 0.25; 'mode': 0.29; 'import': 0.29; 'charset:iso-8859-15': 0.30; 'module': 0.30; 'sort': 0.31; 'does': 0.33; 'to:addr:python-list': 0.33; "i've": 0.33; '2.6': 0.35; 'using': 0.35; 'data': 0.38; 'some': 0.38; 'doing': 0.39; 'client': 0.39; 'to:addr:python.org': 0.39; 'help': 0.40; 'destination': 0.67; 'received:(helo localhost)': 0.73; 'subject:magic': 0.84; 'subject:skip:M 20': 0.84; 'received:ro': 0.93 Date: Fri, 3 Jun 2011 09:28:22 +0300 From: Claudiu Popa X-Priority: 3 (Normal) To: python-list@python.org Subject: Multiprocessing.connection magic MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-BitDefender-Spam: No (0) X-BitDefender-SpamStamp: v1, build 2.8.97.155042, SQMD Hits: InvalidIPBytes34 97.47.107.113, rbl score: 0(0), bayes score: 500(0), pbayes score: 500(0), neunet score: 0(0), flags: [NN_LEGIT_BITDEFENDER; NN_LEGIT_MAILING_LIST_TO], SQMD: 771439a8a29af73898a5080c662be046.fuzzy.fzrbl.org, total: 0(775) X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.0 on elfie.dsd.hq, sigver: 7.37680 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 34 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307082948 news.xs4all.nl 49042 [::ffff:82.94.164.166]:45881 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:6917 Hello guys, While working at a dispatcher using multiprocessing.connection.Listener module I've stumbled upon some sort of magic trick that amazed me. How is this possible and what does multiprocessing library doing in background for this to work? Client, Python 2.6 >>> from multiprocessing.connection import Client >>> client =3D Client(("localhost", 8080)) >>> import shutil >>> client.send(shutil.copy) Server, 3.2 >>> from multiprocessing.connection import Listener >>> listener =3D Listener(("localhost", 8080)) >>> con =3D listener.accept() >>> data =3D con.recv() >>> data >>> help(data) Help on function copy in module shutil: copy(src, dst) Copy data and mode bits ("cp src dst"). =20 The destination may be a directory. >>> =20