I’ve followed Steve Baer tutorial about how to set-up eclipse to write rhinopython code (Rhinocommon and rhinoscriptsyntax) and now I’m setting-up Eclipse to debug code from ghPython and Rhino python editor.
I can debug perfectly python code from the Rhino script editor, but when I debug from Grasshopper, everything works, but I cannot see the code written in the GH component in the eclipse window, neither activate breakpoints into the code. Is there any way to specify to pydevd what code it should run and analyse from GH? I was thinking that could be possible to reference the python code from an external file into the ghpython component and tell pydevd that he have to use that file to debug.
Thanks in advance.
PS.: This is what I have debugging code used in GH component.
Thanks @piac! I’m glad you like it (adding you to the credits :P)
You are totally right @Helvetosaur, the process is a little bit tedious if you don’t have to edit long scripts inside ghPython component, but when you need it, there is not a lot of choices to pick from.
I totally agree with you @Helvetosaur , probably a seamless integration between editors is a nice way to go, but I have some suggestions if this happen, because the rhino.python editor is neither a perfect solution (no proper autocomplete, no linter, no proper outliner…)
Everytime I think about a perfect lightweight code editor, SublimeText comes to my mind: reliable, fast, lot of options to personalize your workflow ( custom code snippets, multiline selection, error linter via plugins, powerful autocomplete python API to create your extensions…) , and code edition tasks…it lacks of proper debugging options but the rest is just perfect to take as example of a good and lightweight code editor.
The autocomplete for all rhinoscriptsyntax and RhinoCommom related stuff plus imported modules is pretty good IMO… I think the current editor is not bad for most “average” tasks and programming skills, at least at my level of operation, I don’t feel limited by it. I would like to see some additional features, though - most importantly code snippets as you mentioned…
Yep! That’s true. What I mean by proper autocomplete is that it doesn’t track your code to offer you variables that you created before, functions or classes created in the document, etc…That stuff speed up the process of writting code a lot. That is because I said “proper” instead of “lack of”.
There is a lot of work to be done on improving the current editors and on simplifying remote debugging with 3rd party IDEs and we’re working on that. You all bring some great points.
Does debugging in ghPython work everytime for you? When I tried debugging rhino scripts using pydev and/or pycharm I couldn’t get it to work everytime (not sure why) but if I enabled “tracing” in addition to “frames” (I was using a custom Rhino Python plug-in that allowed me to enable tracing) then it would work everytime.