injecting functions into a python sandbox within a python program

Graham Menhennitt gmenhennitt at optusnet.com.au
Thu Jan 11 17:47:37 EST 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

Bruno,

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.

Thanks,
	Graham



More information about the Python-list mailing list