By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,551 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,551 IT Pros & Developers. It's quick & easy.

Reloading the already imported module

P: n/a
hi all,
i have following code
if <condition>
from SIPT.xml_param_mapping import
MESSAGE_PARAMETER_MAPPING
else:
from SIPT.msg_param_mapping import
MESSAGE_PARAMETER_MAPPING
parameter_list = MESSAGE_PARAMETER_MAPPING [
'ABC' ]
for parms in parameter_list:

parameter_list[parms][4] = 'EXPORT'

parameter_list[parms][5] = 'IMPORT'
After this the xml_param_mapping gets altered. this process is
repeated over couple of time. But every time i need to get a fresh
xml_param_mapping. So how to relaod the already imported module??

regards
Anil

Jan 11 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
<an**********@gmail.comwrote in message
news:11*********************@o58g2000hsb.googlegro ups.com...
hi all,
i have following code
if <condition>
from SIPT.xml_param_mapping import MESSAGE_PARAMETER_MAPPING
else:
from SIPT.msg_param_mapping import MESSAGE_PARAMETER_MAPPING

parameter_list = MESSAGE_PARAMETER_MAPPING ['ABC' ]
for parms in parameter_list:
parameter_list[parms][4] = 'EXPORT'
parameter_list[parms][5] = 'IMPORT'
After this the xml_param_mapping gets altered. this process is
repeated over couple of time. But every time i need to get a fresh
xml_param_mapping. So how to relaod the already imported module??
Why not work with a copy of MESSAGE_PARAMETER_MAPPING['ABC'], and keep the
original intact? Change:

parameter_list = MESSAGE_PARAMETER_MAPPING ['ABC' ]

to

parameter_list = MESSAGE_PARAMETER_MAPPING ['ABC' ][:]

Now no reimport is required.

-- Paul

Jan 11 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.