Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Can you program?" "Well, I'm literate, if that's what you mean!"


devel / comp.lang.python / Re: How to have python 2 and 3 both on windows?

SubjectAuthor
o Re: How to have python 2 and 3 both on windows?Eryk Sun

1
Re: How to have python 2 and 3 both on windows?

<mailman.240.1650809911.20749.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18023&group=comp.lang.python#18023

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: eryk...@gmail.com (Eryk Sun)
Newsgroups: comp.lang.python
Subject: Re: How to have python 2 and 3 both on windows?
Date: Sun, 24 Apr 2022 09:18:27 -0500
Lines: 40
Message-ID: <mailman.240.1650809911.20749.python-list@python.org>
References: <1766896259.80347.1650605332904@mail.yahoo.com>
<1A496C85-0E6A-432B-B455-581F70F648FD@barrys-emacs.org>
<1897585274.397040.1650763178034@mail.yahoo.com>
<CACL+1au1tLauaQjh592LXBx2sPX0p=crZFJCBAbVzVnAM73BPQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de PEiiJzVX/wZqMD0MBUEpeQ8Uv9gUJvi9ZccvAMdd132g==
Return-Path: <eryksun@gmail.com>
X-Original-To: Python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=n9/ydp+X;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.006
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '(e.g.': 0.05;
'subject:python': 0.06; 'e.g.': 0.07; '"python"': 0.09; 'cc:addr
:python-list': 0.09; 'environment,': 0.09;
'received:209.85.214.173': 0.09; 'received:mail-
pl1-f173.google.com': 0.09; 'skip:# 30': 0.09; 'skip:` 10': 0.09;
'skip:` 20': 0.09; 'support,': 0.09; '3.x': 0.16; 'builtin': 0.16;
'executable': 0.16; 'including:': 0.16; 'paths': 0.16; 'spec,':
0.16; 'subject:windows': 0.16; 'sunil': 0.16; 'variable,': 0.16;
'wrote:': 0.16; 'python': 0.16; 'cc:addr:python.org': 0.20;
'version': 0.23; 'command': 0.23; 'subject:How': 0.23; 'run':
0.23; 'cc:2**0': 0.25; 'environment': 0.29; 'default': 0.31;
"doesn't": 0.32; 'python-list': 0.32; 'received:209.85.214': 0.32;
'message-id:@mail.gmail.com': 0.32; 'path': 0.33; 'script': 0.33;
'same': 0.34; 'header:In-Reply-To:1': 0.34; 'received:google.com':
0.34; 'from:addr:gmail.com': 0.35; 'using': 0.37;
'received:209.85': 0.37; 'file': 0.38; 'put': 0.38;
'received:209': 0.39; 'valid': 0.39; 'use': 0.39; 'something':
0.40; 'want': 0.40; 'try': 0.40; 'search': 0.61; "you'd": 0.64;
'to:addr:yahoo.com': 0.64; 'your': 0.64; 'generally': 0.67;
'exactly': 0.68; 'matter': 0.68; 'skip:# 10': 0.68; 'order': 0.69;
'latter': 0.69; 'virtual': 0.71; 'subject:have': 0.75;
'requested': 0.76; 'names,': 0.81; 'similarly': 0.84; 'line,':
0.93; 'highest': 0.97
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:in-reply-to:references:from:date:message-id:subject:to
:cc; bh=5XEtzie7RZZgHe20vgbrC1Fu4HYuNT3ac7N7znpQmMU=;
b=n9/ydp+XIpYr7bpsaXK/DynjBHcSpi0+qPcuQewj9n1tnYW36oV8/PvoM17G4p8yFs
xXf2vWJVdqPTwGRbjVbE8HGBRmr2A4vWETdPoMlohkGDmKBWg4H/hhI+4XgzNDOreN1A
sgVjPUlSqvXKdI1L3oVy1DI6AW6wZ005+NRC6VVVV2D96anrnOSw69K9/e1qd0BVg5FZ
614+fH1smmr2ZhKF/SqP0nAYBsIMd9rExjgDxGS1DBNAS5kJCozDarPzJhb3FWZtEY8H
8Ha2VpZDPMU//gWh1Heu2M4izuauhisJ8dpdtl7u5mISPQpXrIEeKyxSeh+3NnMzbIYj
YRuw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:in-reply-to:references:from:date
:message-id:subject:to:cc;
bh=5XEtzie7RZZgHe20vgbrC1Fu4HYuNT3ac7N7znpQmMU=;
b=gu/MekqbHw4bvFjRh3mRsnYai0sKOoYwTk3I7u5eo2QjYqYqkIWAXjkXQs27ltBHqW
16lkzPDJZWXLGiov9o5gFox4prRxSSIw8q/S2mIswC8hAV7cHuLN5l4lcHAfdXfuoB4c
SC7SnxGnIaowoh28IZI8SmlQlczdKsUQ7z8bZKtY1Ui4eVTnegSZ5LBfEpr4a1+GJfpR
0WgiAMGk6VKgr6wk0ZBhbD7SOIsL+WmDIJW42816F8oPZsD11Ef7+bTXBHiVl50SHhFZ
DhX5791v5AqxFQL5pu/3ed2JwIPPsSO7OvB/tRbNU9qCO79XRUHr4EHgYfDTCbXnEcG1
wjsw==
X-Gm-Message-State: AOAM530GN1Q39Mvi2EIPpYvvgtgjCrCjUYLtQczWQBgL7Q+hxuQGbRIO
3LJiRu6C59VVB1SzrazPABj4Sk2nZJq1OJllnI8=
X-Google-Smtp-Source: ABdhPJyHoom6o7Tq4S1enI2GC+TNK5Ki/YBQSwMLYEr4QKWRo15Ndn5EYTFZGmdOJfmqHTuYWp6F7+VyapEx3UF4Qjc=
X-Received: by 2002:a17:90b:314c:b0:1d4:d3c5:d8cd with SMTP id
ip12-20020a17090b314c00b001d4d3c5d8cdmr15706827pjb.140.1650809907935; Sun, 24
Apr 2022 07:18:27 -0700 (PDT)
In-Reply-To: <1897585274.397040.1650763178034@mail.yahoo.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CACL+1au1tLauaQjh592LXBx2sPX0p=crZFJCBAbVzVnAM73BPQ@mail.gmail.com>
X-Mailman-Original-References: <1766896259.80347.1650605332904@mail.yahoo.com>
<1A496C85-0E6A-432B-B455-581F70F648FD@barrys-emacs.org>
<1897585274.397040.1650763178034@mail.yahoo.com>
 by: Eryk Sun - Sun, 24 Apr 2022 14:18 UTC

On 4/23/22, Sunil KR via Python-list <python-list@python.org> wrote:
>
> I am happy with how the python starts up. When I use python I get
> python 2. I am ok with using py -3 for my new scripts, even using the
> shebang like #!py -3

`#!py -3` is not a valid shebang for the py launcher. Use `#!python3`
to run a script with the highest version of Python 3 that's registered
on your system. Or for cross-platform support, use
`#!/usr/bin/python3`.

> I don't want to put a unix (or for that matter windows) path in the shebang,
> as it is not platform portable

The launcher supports builtin virtual shebangs, including:

* #!python[X[.Y][-32|-64]]
* #!/usr/bin/python[X[.Y][-32|-64]]
* #!/usr/bin/env python[X[.Y][-32|-64]]
* #!/usr/local/bin/python[X[.Y][-32|-64]]

The implementation of the `/usr/bin/env` virtual shebang searches PATH
for a given command that's exactly "python" (no version spec) or any
command that doesn't start with "python". If a "python" command has a
version spec, then PATH is not searched, and it works the same as a
`#!pythonX[.Y]` shebang. The latter is because a normal Python
installation doesn't include versioned executable names, so the
launcher doesn't even try to search PATH for something like
"python3.11.exe".

You can set the default version to use via the PY_PYTHON environment
variable, e.g. `set PY_PYTHON=3.9`. If Python 3 is requested without a
specific version (e.g. via `py -3` at the command line, or the shebang
`#!python3`), then the default 3.x version to run can be set via the
PY_PYTHON3 environment variable, e.g. `set PY_PYTHON3=3.10`. The
default for Python 2 is set similarly via PY_PYTHON2.

The launcher also supports real file paths in shebangs. Generally
you'd only use a real path in order to run in a virtual environment,
such as #!"C:\Path\to\venv\Scripts\python.exe".

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor