On 19 May 2015 at 17:18, Ben Finney <ben+pyt...@benfinney.id.au> wrote:

> You will be pleased to know of the standard library ‘importlib’
> library::
>
>     >>> import importlib
>

Yes, I already got importlib to accept a string. But I can't figure how to
get dir to accept it:

>>> x = 'shutil'
>>> import importlib
>>> importlib.__import__(x)
<module 'shutil' from 'C:\\Python34\\lib\\shutil.py'>
>>>

If I can get dir to accept x I can parse the output to get rid of the __xxx
stuff and print it out.


-- 
Jim

After not doing dishes for a week and washing spoon after spoon, fork after
fork, knife after knife - I suddenly understand the mathematical concept of
infinity, which is just one more damn thing after another.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to