Nadav Chernin wrote:

Hi all, a have easy question for python developers.

Assume I have list of all objects:

obj=dir()

Now I want to know which object from “obj” list is module.

I searched some method in module inspection, but there is not any method that get ‘string’ as parameters

Any reply will be greatfull

Nadav


import sys
import os
name = 'os'
sys.modules[name]

will return the module itself with the string name. It should allow you to use the method you found using the module itself.

JM
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to