Reload imported modules, Python / Rhino7

Hi guys,

I am developing python scripts that import other scripts from the same directory. It works as expected, however, any changes to the file I am importing do not update until the Rhino is reloaded.

I’ve tried: reload(myModule), as suggested in similar topics, but it does not do the trick. The new methods are still not available. Any ideas?

Similar topics:
How to reload imported modules after editing Win 6 SR21

Python script not updating on rhino

Best,
WK

Hello,

you need to reload the module - It does not work with for instance

from myModule import my_thing
reload(my_thing)

Does that help ? Are you saving the myModule file each time?

Hi

Are you aware of the ResetScriptengine functionality.

iirc it’s a command by the name as stated above.

-Willem

1 Like

I am saving myModule each time, yet.
How would that work though, since Rhino is not seeing updates to the module - I’d have thought to reload myModule rather than a function that doesn’t yet exist? That doesn’t help either.

I came across ResetScriptEngine, reading here: Save all -> reset script-engine -> run. It didn’t help.