【问题标题】:How to set Python IDLE in Windows 10 for opening .py files?如何在 Windows 10 中设置 Python IDLE 以打开 .py 文件?
【发布时间】:2021-10-07 20:28:18
【问题描述】:

现在我的 .py 文件通过 Visual Studio 打开,Python 图标未显示在任何 .py 文件中,但之前我的所有 .py 文件都在 python IDLE 中打开。

如何找回?在cmd 中,如果我输入python,那么我会得到python shell,这意味着python 已正确安装在我的系统中——但是为什么.py 文件在python IDLE 中没有打开?

【问题讨论】:

标签: python python-3.x windows python-idle


【解决方案1】:
  1. 右击.py文件
  2. 打开方式
  3. 选择其他应用
  4. 更多应用
  5. 在这台电脑上寻找其他应用程序
  6. 选择C:\Python36\Lib\idlelib\idle.bat

请注意,C:\Python36 是您的 Python 路径。


你可以像这样找到你的 python 路径:

  1. 打开 Python 外壳
  2. 运行此代码:
import sys

for p in sys.path:
    print(p)

您会看到路径信息列表。您的列表可能会有所不同,具体取决于您的平台、您安装的 Python 版本以及您安装的 Python 功能。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-12-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多