3

I want to add scripting capabilities to my application and I just came across python4delphi http://code.google.com/p/python4delphi/, which seems to be stable. At first sight it looks very easy to use on the developers side, but I couldn't find a way to debug a script. Would be great if I could embed the IDLE IDE in my application, I just have no idea how to do it.

Is there a easy way to add debugging capabilities with python4delphi? Should I use other script engines like pascalScript (seems to have been discontinued)?

Edit: After having a look at PySctipt and pdb I realized that what I am looking is more like a visual editor with embedded debugging and the capability to read python4delphi custom modules (the ones where I export my delphi objects. Being a python noob I have no idea how p4d does this). I am probably asking too much, but would be great to find an implementation of that and not having to code it all from scratch.

  • 1
    `pdb`? You can use `pdb.set_trace()` as breakpoints in your code. – unddoch Nov 05 '12 at 20:27
  • 3
    You may have à look at PyScripter (http://code.google.com/p/pyscripter/) wich has a debugger and use pythonForDelphi – philnext Nov 05 '12 at 22:41
  • @pythonm: Thanks for the hint. I had a look at it and this should work with python4delphi, but pdb is not really user-friendly. Of course I could implement a visual editor, dynamically set breakpoints, hotkeys, etc... but if there is a framework doing that already I would rather use it than code it all myself. – Marcelo Rauter Nov 06 '12 at 00:10
  • @philnext: PyScripter looks promising. If I could make the debugger work with python4delphi scripts it would be perfect, the tricky part is that p4d can import my delphi objects into python, and I think there is no way for PyScripter to read them.... oh well... I think I will have to read the source to find out. – Marcelo Rauter Nov 06 '12 at 00:21

1 Answers1

2

Python is really a great language. But if you need to embed script, with debug, in a Delphi application you should considere Pascal scripting, which is more available in Delphi. I use the excellent PascalScipt, in the exemples you will see editor, debugger and a lot of other functions.

philnext
  • 3,242
  • 5
  • 39
  • 62