[Tutor] Trying to avoid using eval..
rohit_medi at hotmail.com
Sat Feb 23 03:11:19 CET 2013
I want to reload my Module after I fix bugs and want to instantiate an object of a class contained in this module.
Heres the pseudo code of what I want to do:
def rerun(testBlock) :
op = testBlock.split('.')
module = op ; className = op
# testBlock is a string, so it needs evaluation!
newObject = testBlock()
Obviously, line 4 and line 6 dont work today.
I want to know if there is any smart way to achieve this.
In my previous life (Tcl), I could use 'eval' or 'set' to achieve this.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor