0

I have developed a python script that can automate installation taking the inputs from a configuration file(.ini). Now, if we are clicking the ".ini", the editors like notepad opens the .ini file. So, I want to install my python script as a software(like notepad) which can be set as default to open my configuration file(now it is .ini) so that it start executing. How can I do convert my python script as software like notepad?

I have tried using pyinstaller, py2exe but these stuffs provide a python shell packed to execute the script.

  • possible duplicate of https://stackoverflow.com/questions/27494758/how-do-i-make-a-python-script-executable – gireesh4manu Jan 19 '19 at 06:18
  • 1
    @gireesh4manu Probably this is not duplicate, the question is specifically asking for Windows platform. Check [this](https://stackoverflow.com/questions/4235834/how-to-make-python-scripts-executable-on-windows). – Soumya Kanti Jan 19 '19 at 06:27
  • @SoumyaKanti the link I shared had a cross platform solution in it as well. – gireesh4manu Jan 19 '19 at 06:29
  • @gireesh4manu sorry my question was how to develop a software( like vlc media player which can run a .mp4 file format ) using python script. I do have a framework with certain api calls. So i want it to be installed like any other soft wares in windows so that i can open my own file file format with the python script. – Hamanth Gousik Jan 19 '19 at 07:21
  • You'll have to first convert your Python script to an .exe using something like pyinstaller or py2exe. Once that is done, then that executable produced can be associated with a particular application file extension by modifying the Windows registry. There are Windows Installer SDKs that can be used to help do that. This typlically also involves copying the .exe file and any support files needed to a the proper directories for installed applications in the OS (all of which have nothing to do with Python). – martineau Jan 19 '19 at 08:03
  • @martineau Thank you for your answer. Is there anything to be changed in the python script(which is bundled to an .exe? – Hamanth Gousik Jan 22 '19 at 05:03
  • Hamanth: No, for the most part your Python application code should work without modifications. However you will need to write additional, but separate, code to facilitate/control the conversion to an .exe file. – martineau Jan 22 '19 at 11:42

0 Answers0