Desactivating Python keywords and built-in functions

Andr? Roberge andre.roberge at ns.sympatico.ca
Fri Oct 8 10:45:12 EDT 2004


In short:
Is there a simple way to desactivate Python keywords and built-in
keywords [e.g. eval()]

Longer description:
I want to use a subset of Python as an embedded language and don't
want the users to have access to the rest of the language.   One
approach I thought of using would be something along the following
lines:

read in the script for the user;
scan for "forbidden" keywords or expression;
if found, give an error message and stop;
otherwise, let Python interpret the code.

Before I jump and start coding, I thought I would ask people that know
more about these things than me
(which means probably 97.2% of the readership of comp.lang.python  ;-)

André



More information about the Python-list mailing list