简体   繁体   English

如何更改默认的Python Shell版本?

[英]How can I change default python shell version?

I am using Windows 10, and I have python 2.7 and 3.6 installed. 我正在使用Windows 10,并且安装了python 2.7和3.6。 I want to open a .py file in IDLE 3.6, but when I try to open it, it opens in 2.7. 我想在IDLE 3.6中打开.py文件,但是当我尝试打开它时,它在2.7中打开。 How can I change the default? 如何更改默认值?

To make the python-2x or python-3x as default python IDLE, you need to change the environment variable, if you define the path for n versions of python, you will be able to use that particular version by typing that version in cmd. 要将python-2x或python-3x设置为默认的python IDLE,您需要更改环境变量,如果您定义了n个版本的python的路径,则可以通过在cmd中键入该特定版本来使用该特定版本。

See the superuser answer here for step by step instruction 有关逐步说明,请参见此处的超级用户答案。

There are different versions of IDLE installed for each Python version. 每个Python版本都安装了不同版本的IDLE。 Depending on how you installed Python on Mac OS X, you may find different folders in /Applications. 根据在Mac OS X上安装Python的方式,您可能会在/ Applications中找到不同的文件夹。 Look for a Python 3.n (n = 1 or 2) folder with an IDLE in it. 查找其中具有IDLE的Python 3.n(n = 1或2)文件夹。 Or, from a terminal command line, you may find an idle2.6 and an idle3 or idle3.1 or idle3.2. 或者,从终端命令行中,您可能会发现一个idle2.6和一个idle3或idle3.1或idle3.2。

https://stackoverflow.com/a/4776403/3900156 https://stackoverflow.com/a/4776403/3900156

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM