Python Forum
[split] running .py files on Windows
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] running .py files on Windows
#3
(Sep-14-2017, 02:50 PM)metulburr Wrote: I dont mean to hijack but i kind of am doing it
Quote:From there, you can just type "hello.py".
You can just type the filename now in Windows? How do you define which python interpreter goes with which python file? 

File associations.  Windows doesn't care about shebang lines, but if .py is associated with python, then python will be used to "open" the file, which, for python, means it'll be run.  I don't think this works in the file explorer and double clicking the file (it's just opened in your editor for... editing).  There's a special python launcher (pythonw.exe) that ships along with python, which is what file associations are bound to.  THAT will (depending on the version, I think) check for a shebang line, and try to route the script to the right version of python if it's installed.
Reply


Messages In This Thread
[split] running .py files on Windows - by metulburr - Sep-14-2017, 02:50 PM
RE: Can't run .py file - Windows 8.1 - by nilamo - Sep-14-2017, 03:25 PM
RE: Can't run .py file - Windows 8.1 - by snippsat - Sep-14-2017, 04:42 PM
RE: Can't run .py file - Windows 8.1 - by nilamo - Sep-14-2017, 05:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Class test : good way to split methods into several files paul18fr 4 620 Jan-30-2024, 11:46 AM
Last Post: Pedroski55
  Rename files in a folder named using windows explorer hitoxman 3 838 Aug-02-2023, 04:08 PM
Last Post: deanhystad
  Python script running under windows over nssm.exe JaroslavZ 0 787 May-12-2023, 09:22 AM
Last Post: JaroslavZ
  Phyton Opening files on windows C: pc EddieG 3 1,068 Mar-29-2023, 03:19 PM
Last Post: buran
  Split Bytearray into separate Files by Hex delimter lastyle 5 2,994 Mar-09-2023, 07:49 AM
Last Post: bowlofred
Question Take user input and split files using 7z in python askfriends 2 1,200 Dec-11-2022, 07:39 PM
Last Post: snippsat
  batch file for running python scipt in Windows shell MaartenRo 2 2,024 Jan-21-2022, 02:36 PM
Last Post: MaartenRo
  Copying files from a remote Windows station tester_V 11 7,077 Jul-17-2021, 02:19 AM
Last Post: tester_V
  Running script on multiple files Afrodizzyjack 1 2,578 May-14-2021, 10:49 PM
Last Post: Yoriz
  Flask files running order TomasAm 0 1,494 Nov-12-2020, 08:22 AM
Last Post: TomasAm

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020