Home     My Faqts     Contributors     About     Help    

faqts : Computers : Programming : Languages : Python

FAQTs repaired & updated!
Thanks for your patience...
Entry Add Entry Alert - Edit this Entry

Did You Find This Entry Useful?

5 of 8 people (63%) answered Yes
Recently 5 of 8 people (63%) answered Yes

How to create a class instance of a class defined in another file that is not known in advance

Jan 12th, 2004 17:05

Khurram Ijaz, Gregor Leban

Your module name is mymodule and class is myclass
import mymodule
myobj = mymodule.__dict__['myclass']( args_if_any)
Simple answer. I have used it and  it works.

© 1999-2004 Synop Pty Ltd