On 03/05/10 19:24, Pete Emerson wrote:
In a module, how do I create a conditional that will do something
based on whether or not another module has been loaded?
<cut>>
If someone is using foo module, I want to take advantage of its
features and use it in foobar, otherwise, I want to do something else.
In other words, I don't want to create a dependency of foobar on foo.

My failed search for solving this makes me wonder if I'm approaching
this all wrong.

Thanks in advance,
Pete

Hmm how about the module is available, just not imported yet, I would assume that you still would like to use the module then. Perhaps playing around with the imp module might get you what you mean instead of what you say?

--
mph

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

Reply via email to