469,293 Members | 1,319 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,293 developers. It's quick & easy.

Module name to filename and back?


Is there a function to find a filename from a dotted module (or package) name
without importing it?

The imp function find_module() doesn't work with dotted file names. And it
looks like it may import the file as it raises an ImportError error exception if
it can't find the module. (Shouldn't it raise an IOError instead?)

What I'm looking for is to be able to get the full module name when I have a
filename. And get the full filename when I have the module name. And do both
of these without importing the module.

modulename <==filename
filename <==modulename

Ron
Jan 18 '07 #1
0 827

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

70 posts views Thread by Michael Hoffman | last post: by
10 posts views Thread by Xah Lee | last post: by
32 posts views Thread by Matias Jansson | last post: by
reply views Thread by dogatemycomputer | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.