[Tutor] Returning multiple values from a script

John Fouhy john at fouhy.net
Thu Jan 12 02:32:44 CET 2006


On 12/01/06, Hans Dushanthakumar <Hans.Dushanthakumar at navman.com> wrote:
> Any other means of importing dynamically?

There's an __import__ builtin. It's a function that takes a string and
returns the module.

eg:

>>> sys = __import__('sys')
>>> sys.platform
'win32'

[actually, it does a bit more than just that; read the docs]

--
John.


More information about the Tutor mailing list