[Tutor] Network stuff

Alexandre Ratti alex at gabuzomeu.net
Sun Aug 24 13:52:14 EDT 2003


Hi Gerardo,


Gerardo Arnaez wrote:
> Hello all, enjoying the heck out of python. using to
> help set up user accounts at a public internet cafe
> where they will sell these accoutnts in 30 min
> sessions.
> 
> Right now I can get a list of any user and total time
> logged in to one computer.  I break this up into a
> dictionary.
> 
> The problem is that I am not sure how to transmit this
> information.  Ie I have some data I want to sent to
> another application on another computer.

You could setup a minimal server to offer data to the other computer. 
XML-RPC comes to mind; I tested this technology a couple of weeks ago 
and it looked very simple to use.

In Python 2.2+, look into the "SimpleXMLRPCServer" and "xmlrpclib" 
modules in the standard library. There's some doc around too:

The Python Web services developer: XML-RPC for Python, 2002
<http://www-106.ibm.com/developerworks/webservices/library/ws-pyth10.html?dwzone=webservices>

XML-RPC Howto
<http://xmlrpc-c.sourceforge.net/xmlrpc-howto/xmlrpc-howto.html>

XML-RPC in Python, 2000
<http://www.onlamp.com/lpt/a/468>

I can post a code example if you are interested.

For a fancier solution, you could also look at Pyro (Python Remote 
Objects). I toyed with this module yesterday and it's quite easy for a 
client to access an object on a remote server.

http://pyro.sourceforge.net



Cheers.

Alexandre






More information about the Tutor mailing list