Executable clickable python file on Windows 10

Discussion in 'App Development' started by OptionsOptionsOptions, Mar 10, 2020.

    • Windows 10
    • Python 3.8.2

    How can I make a python.py file executable when I click on it? It would run on files in the same directory. Python is working through the Windows command line. In Linux it was easy - but I can't figure it out on Windows 10. I couldn't even get answers through Google.

    A sample script would be great - such as write to text file.
  1. ph1l


    In Windows Explorer, select a .py file then right-click->Open With->More Apps->scroll to bottom->Look for another app on this PC->select your python executable->keep Always use this app to open .py files->OK

    Then it should work when you double click on any .py file from Windows Explorer (probably also on desktop or from start menu too).
    OptionsOptionsOptions likes this.
  2. OK .... thanks for the reply. I will look into it tonight.