[Twisted-Python] PythonCard GUI client for pbecho example

Stephen C. Waterbury golux at comcast.net
Mon Apr 12 14:24:37 EDT 2004

Here's a PythonCard client that works with the pbecho.py
server (I included pbecho.py so it's a self-contained example,
but it's the same pbecho.py as in Twisted/doc/examples).

Dependencies:  PythonCard (http://pythoncard.sourceforge.net)
                (requires wxPython)

Basically, all the logic of tpcpbechoclient was copied directly
from pbechoclient.py -- the only functional difference is the
capability to repeat the "Send" function.

It's pretty self-explanatory, but anyway:

* start up server:  python pbecho.py
* start up client:  python tpcpbechoclient.py
* when client comes up, click "Login" button
   -> "CONNECTED" should appear on lower right side of panel
      (meaning the client received a perspective)
* enter something into the text field at the bottom
* click "Send" button
   -> the text should be echoed in the text area widget above

(Note:  if you have PythonCard installed as PythonCardPrototype,
either change the name of your installation to PythonCard or
do the substitution in my example code.  PythonCard is about to
undergo the name change in its next released version.  If you use
the CVS version, it's already re-named.)

- Steve

P.S.  Itamar:  I couldn't get the wxreactor to work with PythonCard;
kept getting "AssertionError: reactor already installed", although
I followed the directions in wxreactor's docstring.  I tried various
permutations but finally got tired of messing with it ...
let me know if have time to play with it and find a way that works!

For now, I'm using my "twistedpythoncard" module, which encapsulates
Uwe's timer recipe so the rest of the code can use normal Twisted
and PythonCard idioms.  That seems to work pretty well, but I will
be trying some more non-trivial examples before I declare success.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tpcpbechoclient.tar.gz
Type: application/gzip
Size: 2245 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20040412/5c27e681/attachment.bin 

More information about the Twisted-Python mailing list