initialising a class by name

Sion Arrowsmith siona at
Wed Jan 14 14:55:38 CET 2009

Krishnakant  <krmane at> wrote:
>By the way, is there a kind of global list of modules/classes which are
>maintained in a package once the program is loaded into memory?

sys.modules is a dict of loaded module objects, keyed by module name.

>>> getattr(sys.modules["sys"], "version_info")
(2, 5, 0, 'final', 0)

\S -- siona at --
   "Frankly I have no feelings towards penguins one way or the other"
        -- Arthur C. Clarke
   her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump

More information about the Python-list mailing list