How to get the update without restart Maya if script changes?


#1

Hi guys,

In trouble to get the update of script in maya editor, my things is like: I have two py files, a.py and b.py.
In a.py file, I import b.py, and both these files are located in \document\user…\maya\mayaversion\scripts. Then:
1. Open these two py files in maya script editor, after doing some changes in b.py file, save it and execute

2.Run the a.py file(actually a.py is the UI toggle file, b.py include all functions), but the a.py file seems still execute the old b.py file. Cannot see any result it supposed to generate.
Everytime i have to restart maya if i want to see the right result after changing, this is really time-consuming, anyone can help me?


#2

try to reload the script after importing it

import b as #whatever nameSpace
reload(nameSpace)

hope this helps.


#3

yep, this is what I need, Thanks!


#4

additional description to ranjith17: reload(namespace) can only take the file name not the functions from there.