How to debug a Python extension?

Howdy y’all,

I’m trying to add a feature to the Linguist extension. I added a new command, but when I try to execute it, nothing happens. It’s likely an error somewhere in the code I added, but I can’t figure out what’s wrong.

Is there a logfile somewhere (on Windows) that stores output created by the Python script? That way, I can put print() statements to see what’s happening.

Otherwise, how can I create a popup so if there is an error, I can show it on the screen? Or se the popups to track where I am in the script.




As for a log file, I have been using this for a while now → How to catch libreoffice macro errors and forward to a Python log file?

There are also console methods:

1 Like

Thanks, I should be able to figure it out with those links!


Maybe this link also could help: Development/Extension Development/Python Extensions Development - The Document Foundation Wiki