[Pythonmac-SIG] rendezvous and python
Etienne Posthumus
etienne at cs.vu.nl
Thu Sep 25 04:21:54 EDT 2003
On donderdag, sep 25, 2003, at 00:37 Europe/Amsterdam, Bob Ippolito
wrote:
>
> On Wednesday, Sep 24, 2003, at 18:27 America/New_York, edd thompson
> wrote:
>
>> Does any body have any info about rendezvous and possibly how to code
>> it?
>> Or should I try write a library myself, which haven't a clue where I
>> would start with that either.
>
> And then just use PyObjC ( http://pyobjc.sourceforge.net/ ) instead of
> ObjC to manipulate the NSNet* classes.
There is a very nice example in the PyObjC examples directory, called
'rendezvous.py'
(What? Such a cryptic name? Never! ... :-)
See: /Applications/MacPython-2.3/Extras/pyobjc-1.0b1/Examples/
It gives a _working_ example of how to do it.
When you code your own, watch out for the gotcha:
The rendezvous code does the discovery of stuff in the background. Upon
finding results it calls the delegate. To do this it needs a runloop,
that is where the
runloop.runUntilDate_(untilWhen)
code on line 58 in the example comes in.
In a normal Cocoa Application that gets started from a bundle you will
automatically get a runloop as part of your NSApplication so no
worries, but when writing 'toy' scripts and playing in the interactive
interpreter you get strange network errors until you figure out this
runloop thing.
Etienne Posthumus
More information about the Pythonmac-SIG
mailing list