Is there a way importing a string object?

Ian Kelly ian.g.kelly at gmail.com
Mon Jan 4 19:56:09 EST 2016


On Mon, Jan 4, 2016 at 5:49 PM,  <jfong at ms4.hinet.net> wrote:
> For example,
>
> name = "test"  # test.py is a module's file
> import name

Yes, use the importlib.import_module function.



More information about the Python-list mailing list