473,385 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Reloading the already imported module

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
1 1125
<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Andy Jewell | last post by:
Does anyone know of a way to dynamically reload all the imported modules of a client module? I'm writing a program that I have broken down into quite a few submodules, and the 'configuration'...
0
by: OKB (not okblacke) | last post by:
I'm fooling around with some MUD server code, and I want to add a "reload" command that will let MUD wizards reload the server modules, so that changes to the MUD parser and such can be effected...
2
by: aurora | last post by:
I am looking for a way for reloading updated modules in a long running server. I'm not too concerned about cascaded reload or objects already created. Just need to reload module xxx if the...
2
by: Lowell Kirsh | last post by:
I have a driver module as well as several other modules. I am running the driver interactively from emacs - that is, I don't restart python on each run. I want to work it such that every time a...
4
by: Martin M. | last post by:
Hi, I have the following question: How can an imported module see/find the path to itself? Background: From my main script I import a module which needs a file (AppleScript) located in the...
10
by: Michael Abbott | last post by:
It seems to be an invariant of Python (insofar as Python has invariants) that a module is executed at most once in a Python session. I have a rather bizzare example that breaks this invariant: can...
4
by: aine_canby | last post by:
I'm using python.exe to execute my modules. I have a music.py module which contains my classes and a main.py module which uses these classes. In python.exe, I call "import main" to execute my...
3
by: schpok | last post by:
When I "from foo import *" in my __init__.py, sometimes module foo's docs will be expanded in the pydocs. It seems to depend in what language foo was implemented. For example, if you "from math...
4
by: RgeeK | last post by:
I have a main module doStuff.py and another module utility.py. At the start of doStuff.py I call import utility.py Then I also proceed to initiallize some global variables sName = "" ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.