On 7/1/2014 10:55 AM, Marius Liebenberg wrote: > > On 2014-07-01 17:37, Sebastian Kuzminsky wrote: >> On 7/1/14 02:40 , Marius Liebenberg wrote: >>> What is the best way (or any way) to debug python scripts that are >>> loaded as hal components. I need to create a break point to see what >>> data arrived into a variable. >>> >>> Currently I am loading the script with halrun so it does not operate >>> under linuxcnc per say. Until it works. >> I usually use "print" for that kind of debugging. > I am not a python programmer so it is a bit of a steep learning curve. I > will try that.
It is not necessary to launch python HAL scripts from halcmd or the hal file directly. Instead, just run the code you're testing directly from the command line. When I was writing the python thermistor code for my 3D printer, I just started up the realtime subsystem (launch LinuxCNC, run "realtime start", etc) and then manually launched the Python script from the command line. This way you can interact with python (see the print outputs, provide keyboard input, etc), and you should be able to even use a debugger normally. I never had anything I couldn't work out by just manually typing into python (which can be very interactive, like a shell) so I didn't dig into the availability of an actual debugger. -- Charles Steinkuehler [email protected]
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft
_______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
