On 16.06.2005, at 20:59, Shankar Iyer ([EMAIL PROTECTED]) wrote:

> Hi,
>
> Suppose I have a string, sModuleName, that contains the name of a 
> module.  I now want to see what functions are in that module, but if I 
> call dir(sModuleName), I instead get the list of operations that can 
> be done on a string.  Is there any way to convert the string into a 
> format that I could feed to dir to cause the desired effect?  I think 
> I could modify the string a bit and then use the exec command, but I 
> was advised against that on this board last week.

you have to import the module:

name = "sys"
mod = __import__(name)
dir(mod)


- harold -

--
Bitte verlassen Sie diese Welt so,
wie Sie sie vorfinden möchten.
--

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

Reply via email to