I am using Python 3 and PyQt4 (and Kubuntu 12.04).
I often use QtCore.Qprocess.startDetached (QString program, QStringList arguments) to start a program to process a file specified in the arguments.
I want a corresponding manner to start processing the specified file without specifying which program to use. Rather I want to start the default program available, e.g. OpenOffice or LibreOffice or any other program designated as the default word processor for an .odt document file.
Alternatively, is there a way to ask the system which is the default program to use?
/ingemar
QDesktopServices.openUrl(QUrl('file:///home/test/test_document.odt'))
Alternatively, you can use the system commands xdg-open
(Linux) and start
(Windows).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With