Embedding Python in a MUD

Jp Calderone exarkun at flashmail.com
Tue Mar 21 12:40:36 EST 2000


Greg Miller wrote:
> 
> I'm considering Python as an in-mud scripting language. I have a few
> questions I haven't been able to find the answers to:
> 
> (1) Are there any good tutorials on python embedding?

 The Embedding/Extending section of the documentation at www.python.org
is a good place to start, assuming your mud is in C/C++.  Otherwise it
varies.

> 
> (2) Can multiple python interpreters run in separate threads without
> interfering with each other (data corruption, locking, etc)?
> 

  Depends on the interface, again.  JPython, for example, provides a
PythonInterpreter class that is multi-thread safe.  Details on this
are in the embedding/extending docs ("Thin Ice").

> (3) Is there an easy way to serialize/deserialize objects to a custom
> database?

 With your __repr__ method ;)  Check out the Pickle module, though, if
you haven't already.  It is basically capable of converting any object
to a string, and then back to the object.

 Jp Calderone

-- 
1.79 x 10^24 furlongs per picofortnight - It's not just a good idea, 
			It's the law!
--
 5:34pm up 15 days, 3 min, 1 user, load average: 0.04, 0.03, 0.00



More information about the Python-list mailing list