On Wed, 17 May 2017 05:14 pm, Terry Reedy wrote:

> On 5/17/2017 2:04 AM, jeanbigbo...@gmail.com wrote:
> 
>> Question: Is there a solution to this "turn a string into the module it
>> represents" problem?
> 
> Built-in function __import__


Like all dunders, __import__ is intended for the interpreter's use. In
modern Python, the way to import a module by name is:

import importlib
module = importlib.import_module("name")




-- 
Steve
Emoji: a small, fuzzy, indistinct picture used to replace a clear and
perfectly comprehensible word.

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to