How does pyqt5 open files by default?

for example, after double-clicking the HTML file in the gui interface, open the file with the default browser
pyqt5. Is there such a function or method?

Oct.17,2021

I don't know if python provides a built-in solution, you can check it out.

I think we can directly call the open file program built into the operating system and let the operating system decide how to open it. For example, the program of windows is explorer.exe , the program of Linux is xdg-open , and the program of Mac OS is open

.

for example, if you judge that it is the current windows operating system, use:

os.system('explorer.exe "path\\to\\file"')
Menu