[Tutor] Returning multiple values from a script

Orri Ganel singingxduck at gmail.com
Thu Jan 12 02:34:46 CET 2006


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.



More information about the Tutor mailing list