When writing a Nautilus Script (e.g. using Python), I currently am aware of two methods for basic debugging:
- Using (e.g. Zenity) pop-up windows as "print" statements.
- Capturing stderr and stdout in text files for later reference.
These methods work reasonably well, but I suspect that there are more effective methods that I am not aware of. Can anyone suggest other methods?
Edit:
Context: I sought methods to debug a python script launched from the Ubuntu right click menu in Nautilus.
Using cedric's answer of relaunching nautilus with --no-desktop option means that stderr and stdout becomes visible at the terminal window. However, this terminal does not appear to be usable as a pdb console for debugging (it seems to be output-only).
In my search for a way to get input and output access to the script process when launched from the right click menu, I found the information listed in my answer below.
(Also, while I agree that unit testing and logging is best practice, I would argue that there is still a place for interactive debugging, particularly with small scripts.)