Editing and Debugging Sho Code with Visual Studio 2010 and IronPython Tools

If you're writing substantial amounts of Sho code, and especially if you're doing GUI programming, you'll find that print statements just don't cut it after some point for debugging.  If you want to set breakpoints, inspect variables, walk the stack, etc., IronPython Tools for Visual Studio 2010 provides a great solution.  It's also good for editing Sho code, with syntax highlighting, basic type inference (it will guess at the types for your code even when you're not running it), and more.  Note that if you want to use it as an editor, I'd strongly suggest going into Tools->Options->Text Editor->IronPython->Tabs and select "Insert Spaces" instead of "Keep Tabs" - tabs make it extremely difficult to debug indent/dedent errors in Python.  Of course, you don't have to use Visual Studio for editing Python - Emacs, Vim, and a variety of other tools have excellent Python support - but if you're already using Visual Studio for C#, you may find it handy to deal with all the files for a project in one enviornment.

To debug your code, you can still use the Sho Console - just attach the debugger to the shoconsole.exe process, set your breakpoints, and continue as normal.  When your breakpoints are hit, execution will stop and you can step through code, inspect variables, and all the rest.  You can see a walkthrough of the debugging process in this video I put up on the Sho Videos page


Comments (0)

Skip to main content