How to re import a module

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to re import a module

hidura
Hello i want to know the best way to re import a module, because i have a web server with just one Apache session for all my domains and applications, and i if i need to make some changes on one application restart the server will affect the others, so i was thinking in 2 ways the first will be 're imported' the module, the second use subprocess. First the less unsecured that in this case i think is re import the module, give me your opinions please.


---
Thanks in advance
Diego Hidalgo
--
http://mail.python.org/mailman/listinfo/python-list
Reply | Threaded
Open this post in threaded view
|

Re: How to re import a module

Rafael Durán Castañeda
That's really easy:

>>> import re
>>> reload(re)
<module 're' from '/usr/lib/python2.6/re.pyc'>
>>>

In python2.x, but if you are using python3.x I think is different, really easy to know if you search in python docs.

2011/4/8 <[hidden email]>
Hello i want to know the best way to re import a module, because i have a web server with just one Apache session for all my domains and applications, and i if i need to make some changes on one application restart the server will affect the others, so i was thinking in 2 ways the first will be 're imported' the module, the second use subprocess. First the less unsecured that in this case i think is re import the module, give me your opinions please.


---
Thanks in advance
Diego Hidalgo
--
http://mail.python.org/mailman/listinfo/python-list



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