Is it possible to reload a module from a different file?

I

ilochab

I mean ...

The main module makes this import:


import moduleX


later other modules make different import to an other module named
moduleX like this:


from pack.subdir import moduleX


What I want is that the second import of moduleX in some way must be
redirected onto the first one.

Is there any way to do so?

Would there be any way to do so (moduleX overrides pack.subdir.moduleX)
if they were imported on reverse order?


Any time I discover that Python can do amazing things, but perhaps this
one is just a silly one, isn't it?

ciao
Licia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,689
Members
48,796
Latest member
Greg L.

Latest Threads

Top