I'm trying to help with a WorkBench development written in Python.
Is there a way to reload python code that belongs to the WB without the need to restart the whole FreeCAD application?
Switching to another WB and back didn't help

Thanks.
Code: Select all
Gui.doCommand("import " + modul)
Gui.doCommand("import " + self.lmod)
Gui.doCommand("reload(" + self.lmod + ")")
Gui.doCommand(self.command)
Code: Select all
reload(SomeModule.py)
i remember that is don't work out of the box with py3...triplus wrote: ↑Wed Jul 18, 2018 9:43 amUsually doing:
Works just fine. That is when you changed code in SomeModule.py and it was already imported.Code: Select all
reload(SomeModule.py)
This works with Python 3:
Code: Select all
reload(MyModule)
Code: Select all
FreeCADGui.addCommand('MyModule', MyModule())
Code: Select all
import someModule
from importlib import reload
reload(someModule)