[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: Executing other python code

Matthew_WARREN

1/31/2008 11:43:00 AM


Not a python solution, but if you look into how this was achieved with Java
it may give hints to the technique needed in python;

robocode, lets you specify your robot AI as java code. You design the AI,
download a bunch of AI's written by other people and the robocode engine
simulates a battle between them all.

It's exactly what you've described, with 'ships' replaced with 'robot
tanks'

http://robocode.sourceforge.net/develope...

I'm interested in the technique used to achieve it, and if it can be done
in python.

Matt.





Internet
bladedpenguin@gmail.com
To
python-list
Sent by: cc
python-list-bounces+matthew.warren=uk.bnpparibas.com@
python.org Subject
Executing other python code
29/01/2008 00:18










I'm working on a game, and I'd like players to be able to define thier
ships with scripts. Naturally, I don't want to give them the entire
program as thier romping ground. I would like to invoke a seperate
interpreter for these files, and give it a limited subset of the
functions in my game. What is the best way to achieve this effect?
--
http://mail.python.org/mailman/listinfo/p...



This message and any attachments (the "message") is
intended solely for the addressees and is confidential.
If you receive this message in error, please delete it and
immediately notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message.
BNP PARIBAS (and its subsidiaries) shall (will) not
therefore be liable for the message if modified.
Do not print this message unless it is necessary,
consider the environment.

---------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le
"message") sont etablis a l'intention exclusive de ses
destinataires et sont confidentiels. Si vous recevez ce
message par erreur, merci de le detruire et d'en avertir
immediatement l'expediteur. Toute utilisation de ce
message non conforme a sa destination, toute diffusion
ou toute publication, totale ou partielle, est interdite, sauf
autorisation expresse. L'internet ne permettant pas
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.
N'imprimez ce message que si necessaire,
pensez a l'environnement.