2

I'm getting started with SharpDevelop and IronPython, and I have been having issues with basic debugging.

First, how do I deal with unhandled errors?

While using Debug->Run, if there's an error in my application, a message will briefly flash on the ipy console, but the the app will immediately close along with the ipy console. This must be a simple fix but I've been having difficulty finding it.

If I use Debug->"Run without debugger", I do get an post-compile unhandled exception error message, but it's in a format that would be difficult to parse for a decently-sized app.

Second, the "watch" window seems almost useless. It doesn't seem to recognize python form control objects (i.e. "self._textBox1), and throws unhandled exceptions often.

Third, there seems to be a LOT less context help than I've come to expect from a python IDE, especially on those same form controls. And in a similar way, putting the mouse arrow over a variable while on a breakpoint rarely shows me anything.

So perhaps my environment is misconfigured! If someone has all or most of this working, I would love to hear (or be pointed to) how this can be fixed. The GUI form designer is way cool, but it's not worth constant debugging hassles.

EDIT: The answer I've chosen shows, I think, that I really cannot recommend using SharpDevelop with IronPython right now.

2 Answers 2

1

The IronPython support in SharpDevelop is fairly basic and has lots of limitations.

I would look at using Python Tools for Visual Studio instead which is free, open source and maintained by a team at Microsoft. It has better code completion and debugging support.

The only things it does not have when compared with SharpDevelop are:

  1. Forms designer
  2. Support for converting code to IronPython (C# to Python).
Sign up to request clarification or add additional context in comments.

5 Comments

The form designer was the main reason why I would choose IronPython in the first place. Otherwise, why not just use something like PyQt or PySide? You can use Qt Designer for forms. BUT I've heard you can design the forms in C# and subclass them, though I haven't seen many people doing that.
Yes, PyQt or PySide could be used instead. I suggested Python Tools for Visual Studio since it is an IDE similar to SharpDevelop, that is the only reason. Yes you can create a form in C# using the WinForms designer and then subclass it in IronPython. In the IronPython code you would inherit from a different Form class or just use the custom form directly.
Hey, silly question: how do you know that SharpDevelop has "lots of limitations" for IronPython? I feel like I'm seeing that, but I would like a bit of "backup" to tell my boss.
I know because I wrote the IronPython addin for SharpDevelop :)
HAHA! That is good backup! And yeah, your response is really the best response in the context of my question.
0

this is a bit longer then a comment, so I'm just putting it as an anwer for the sake of clarity.

myself I still don't like that Python Tools For VS doesn't have GUI editor - so I decided to try using SharpDevelop - i had the exact above problem - but just found useful the following thread (answered by Matt Ward too - thank you and cheers!) http://community.sharpdevelop.net/forums/p/16639/45253.aspx

so, first of all I too had some default Bitmaps on ToolStripButtons, which were causing the exception in the beginning that flashed and went away - i saw the exception by going to command prompt, in the place where the project was and invoking ipy Program.py there (i found out afterwards that actually sharpdevelop compiles stuff - didn't realize that with VS)

then I was able to actually debug and hit breakpoints by actually not choosing Debug, but Step Into. it's a bit cumbersome, not knowing where the program will crash etc. and trying various breakpoints etc. but I really like the GUI designer in SharpDevelop, it's really neat, and i was apalled at the fact that it wasn't in VS+IronPython..

and yeah. the Watches etc. don't work quite often and cause exceptions in SharpDevelop itself - so i won't rely on them - but ok - this won't matter to me, much, ... i hope :P

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.