injecting functions into a python sandbox within a python program

Graham Menhennitt gmenhennitt at
Thu Jan 11 23:47:37 CET 2007

Bruno Desthuilliers wrote:
 > If all your helper functions are really methods of the Interface
 > instance, you may try this instead (NB : not tested):
 > glob = {
 >   'i': i,
 >   'f1': i.whatever,
 > }
 > exec script in glob


Thanks for replying.

Some of the functions are as simple as that so I can do as you 
described. Some are more complicated so it doesn't work. For now I'll 
stick with the prepending.


More information about the Python-list mailing list