Whenever a change is made in Python’s package (any package similar to rhinoscriptsyntax), the change is ‘not available’ the first time I run the code from ghpython component. It takes a second run for the change to be ‘available’.
This is not the case with Rhino Python Editor, where the change is instantly ‘available’ after the first run.
Here is an example:
Create a new function ‘TestFunction’:
def TestFunc(): print("this is a test function")
in one of modules (let’s call it “module1.py”) and save that module file.
In ghpython component, if I try to call the ‘TestFunc’:
import somecustompackage as scp import imp imp.reload(scp) scp.TestFunc()
An error appears that no such function exists in ‘somecustompackage’ module.
If I try to run the script again, everything works fine, and “this is a test function” is printed to console.
I understand that the way I explained it, may not be quite clear.
But any comment on this would be appreciated.