Python Forum
[split] launch .PY program
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] launch .PY program
#4
(Sep-28-2016, 02:58 PM)metulburr Wrote:
(Sep-28-2016, 02:55 PM)sparkz_alot Wrote: An example is, starting with v3.3, windows now recognizes the shebang line, so now
Python Code: (Select All)
#! /usr/bin/env python3 

works in both Linux and Windows.

I have never heard of this. How exactly would windows know where to find python as the shebang line path is linux binaries directory?

It's here (about halfway down) https://docs.python.org/3/using/windows.html, I took the liberty of using their sample and ran it using python, python2 and python3 in that order (note: I do not have python v2)

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\>cd python
C:\Python>test.py
hello from Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)]
C:\Python>test.py
Requested Python version (2) is not installed
C:\Python>test.py
hello from Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)]
C:\Python>
pretty cool :cool:
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Messages In This Thread
[split] launch .PY program - by sparkz_alot - Sep-28-2016, 02:55 PM
RE: [split] launch .PY program - by sparkz_alot - Sep-28-2016, 05:16 PM
RE: launch .PY program Help - by metulburr - Sep-28-2016, 02:58 PM
RE: launch .PY program Help - by nilamo - Sep-28-2016, 03:05 PM
RE: launch .PY program Help - by sparkz_alot - Sep-28-2016, 03:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  launch processes from threads Skaperen 9 1,036 Feb-21-2024, 01:16 AM
Last Post: Skaperen
  [split] the best python teaching program for an 8 year kid? ThomasMoore 2 2,422 Apr-16-2019, 09:12 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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