reimport module every n seconds

Santiago Caracol santiago.caracol at
Thu Feb 17 16:23:47 CET 2011


a server program of mine uses data which are compiled to a Python
module for efficiency reasons. In some module of the server program I
import the data:

from data import data

As the data often changes, I would like to reimport it every n (e.g.
10) seconds.

Unfortunately, it is rather difficult and probably not a good idea to
manipulate the main function of the server program, as it comes from
Django. (Already asked in the Django newsgroup, but I got no answer
there.) Is there a way to do the reimport in a module that is used by
the main program?


More information about the Python-list mailing list