471,896 Members | 1,171 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,896 software developers and data experts.

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 901

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
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.