> One simple solution would be to forbid import statements in the
> scripts, to import the scripts as modules and inject whatever
> functions you want them to be able to use in the module's namespace.
how do you 'forbid' imports?
Guyon
http://gumuz.nl
--
http://mail.python.org/mailman/listinf
Subject
Executing other python code
Hi,
Tim Rau wrote:
> 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
Over-simplified yes, but it will work!
Python is beautiful :-)
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 29, 12:18 am, Tim Rau <[EMAIL PROTECTED]> wrote:
> 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,
Tim Rau wrote:
> 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
> fu
AFAIK this can't be done with just python. You can use the C API of
Python to achieve this. I don't know the details of that, but I guess
you will need this (http://docs.python.org/api/api.html).
Rolf
Tim Rau wrote:
> I'm working on a game, and I'd like players to be able to define thier
> ship
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 i