[Ironpython-users] Gradually executing a python script

Jesper Taxbøl jesper at taxboel.dk
Mon Jul 23 11:31:10 CEST 2012


I am not that familiar with Ironpython yet, but I have a question that I
hope you can help me answer.

I am working on a programming-game where I will allow users to do some
simple python scripting against a simple API that I will control a game
character. Instructions like move and shoot etc, alongside some simple
sense functions that return info on the game world.

My current prototype creates an ironpython engine for each game character
and executes the script in a thread by itself, which sort of works. But I
have the problem that the outcome of executing the game gives different
results every time. Therefore I would like to ask the question:

Is it possible to execute a script inside the Ironpython engine gradually?

I imagine that I could update a list of engines with a tick(int cycles) and
get a fair sharing of resources between engines and ensure the same result
every time.

Kind regards


As this is a programming game I would also like to be able to limit the
available memory each script is using. Is there a way to limit this, so a
script like this would be killed.

x = 0
v = {}
while True:
   x= x + 1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20120723/8d681277/attachment.html>

More information about the Ironpython-users mailing list