Randy, I believe the rexec module has what you are looking for. You can fairly effectively sandbox code by restricting the modules which can be imported, although it won't guard against things like infinite loops.
http://www.python.org/doc/current/lib/module-rexec.html -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Randy Heiland Sent: Friday, January 17, 2003 9:19 AM To: [EMAIL PROTECTED] Subject: [Webware-discuss] eval,vars,namespaces While I continue searching for an answer at python.org, I'll pose my question to this (very helpful) mailing list as well... I want my servlet to be able to execute/evaluate arbitrary Python cmds and assign output to arbitrary variables which will be referenced later. Can someone offer pointers for safely doing this? thanks, Randy ------------------------------------------------------- This SF.NET email is sponsored by: Thawte.com - A 128-bit supercerts will allow you to extend the highest allowed 128 bit encryption to all your clients even if they use browsers that are limited to 40 bit encryption. Get a guide here:http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0030en _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss ------------------------------------------------------- This SF.NET email is sponsored by: Thawte.com - A 128-bit supercerts will allow you to extend the highest allowed 128 bit encryption to all your clients even if they use browsers that are limited to 40 bit encryption. Get a guide here:http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0030en _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
