I did a software in Python, wrapped in an NSIS installer for Windows. I have data files in my software and I want to be able to edit them by clicking on an "Edit" button in my GUI. My problem is that those data files have a new file extension, so when I try to open it using os.startfile()
, Windows tells me it does not know which application to use for opening them.
I don't want to call a particular text editor, I want to use the default editor configured for text files on the system (i.e. sublime for me but notepad for my neighbor...).
I tried adding a key in the Windows registry for my extension with NSIS, saying it is "PerceivedAs" textfile but it does not change anything.
Is it possible to add something to the Windows registry to tell it to open a specific extension with the default txt editor?
Is itpossible in Python to open a file with an unknown extension using the default txt editor?