<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I'm making a game where you'll be able to make your own mods and I | want to be able to write these mods in python. However, python has a | lot of "dangerous" functions (like erase any file on the harddrive | etc) so I want a "safe" python. I first found RExec but that is | disabled in python 2.5 so I was thinking about building python from | source with a few changes.
There are modable commercial games, such as CIV4 I believe, that use Python as the scripting language for both the authors and modders. I presume they use customized interpreters, without the open and file builtins and process, socket, etc modules, and probably a customized import. But I have never seen an article or report on exactly what changes there are. There is also the question of what to about 'hang up' code like 'while True: pass', but that is less a concern for a game run on home machines than a web server. Anyone doing that could be blackballed from the mod distribution site without having trashed anyone's system. tjr -- http://mail.python.org/mailman/listinfo/python-list