Debugging python code.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Debugging python code.
little side note: spyder has some nice tools to interactively test/ debug. Currently it only works with pyqt, but I already tried it with pyside and there is not much missing to make it work. Spyder is modular and maybe some widgets could be integrated in FreeCAD directly.
Re: Debugging python code.
It's been a while I worked with Winpdb but IIRC you should put the file to a location where FreeCAD can find it.I assume that I have to copy something to do with rpdb2 to somewhere in FreeCAD
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: Debugging python code.
Okay I am close but no cigar.
I start FreeCAD
I load my script
In winpdb open source file .../importCSG.py
Set a break point in importCSG
press F6
And winpdb just stays STATE RUNNING and never seems to reach the breakpoint in importCSG.py
I start FreeCAD
I load my script
Code: Select all
import rpdb2
rpdb2.start_embedded_debugger("test")
import FreeCAD
open("/Users/keith/Desktop/Problem/test2.csg")
Code: Select all
press F6
Start winpdb
attach
Set a break point in importCSG
press F6
And winpdb just stays STATE RUNNING and never seems to reach the breakpoint in importCSG.py
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: Debugging python code.
Also tried setting break point to open statement.
Will break there but STEP INTO does not seem to work, just says RUNNING again
Will break there but STEP INTO does not seem to work, just says RUNNING again
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: Debugging python code.
Is anybody using winpdb to debug python code under FreeCAD?