Hans Dushanthakumar wrote: >Oops answered my own question. Dynamic importing is done using the >__import__ function: > >t = ["test1.py", "test2.py"] #Actually this list is filled in by a >Tkinter Listbox selection. > >for f in t: > testname = f[:-3] > test = __import__("%s"%(testname)) > res = test.run_test() > >Cheers >Hans > > > I think your method is less a Bad Idea (tm) than mine, so please disregard previous message.
Cheers, Orri -- Email: singingxduck AT gmail DOT com AIM: singingxduck Programming Python for the fun of it. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor