load a class dynamically
Jeremy Lowery
jslowery at hotmail.com
Fri Nov 30 21:48:58 EST 2001
More information about the Python-list mailing list
Fri Nov 30 21:48:58 EST 2001
- Previous message (by thread): MIT AI Mailing List
- Next message (by thread): load a class dynamically
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I know that implementing this may be a little bit of work, but could someone point me in the right direction? Have a text file that only contains a class definition, or just a string for the sake of simplicity. str = "class myClass:\n\tdef __init__(self):\n\t\tself.v = 1" #the magical code goes here. obj = myClass() # of course, it doesn't have to be called like that, but to #get the ability to instantainate that class. Jeremy
- Previous message (by thread): MIT AI Mailing List
- Next message (by thread): load a class dynamically
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list