[Ironpython-users] Gradually executing a python script

Kevin Hazzard wkhazzard at gmail.com
Mon Jul 23 16:27:52 CEST 2012

Why don't you use a scripting host and inject commands into a ScriptEngine
reusing a ScriptScope as you need to execute them?


On Mon, Jul 23, 2012 at 5:31 AM, Jesper Taxbøl <jesper at taxboel.dk> wrote:

> Hi,
> 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
> Tax
> P.S:
> 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:
>    v[x]=x
>    x= x + 1
> _______________________________________________
> Ironpython-users mailing list
> Ironpython-users at python.org
> http://mail.python.org/mailman/listinfo/ironpython-users

*W. Kevin Hazzard*
Consultant, Author, Teacher, Microsoft MVP
(804) 928-3444
book <http://manning.com/hazzard> |
twitter <http://twitter.com/#!/KevinHazzard> |
linkedin <http://www.linkedin.com/in/kevinhazzard> |
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20120723/6ccf141d/attachment.html>

More information about the Ironpython-users mailing list