使用cmd运行IDLE

问题描述 投票:0回答:1

我无法在 Windows 10 操作系统上使用命令提示符运行 Python IDLE。

C:\Windows\System32>IDLE
'IDLE' is not recognized as an internal or external command,
operable program or batch file.

C:\Windows\System32>IDLE (Python 3.10.6 64-bit)
'IDLE' is not recognized as an internal or external command,
operable program or batch file.

也重新安装了它。这似乎不起作用。 在没有 GUI 的情况下,以交互或脚本模式打开它的可能方法是什么?

有什么建议吗?

windows cmd python-idle
1个回答
0
投票

转到您的Python安装并输入

dir /s idle.*

检查可执行文件 -idle.bat 或idle.cmd 或idle.exe。就我而言,它在 c:\ProgramData\Python�\Lib\idlelib

中列出了idle.bat

将其添加到环境变量中的路径中(假设您知道如何执行此操作)。完成后,关闭 cmd 提示符并启动新的提示符。

现在输入

where idle.bat

就我而言,它返回了

 c:\ProgramData\Python\310\Lib\idlelib\idle.bat

这意味着它可以找到空闲状态并且您的路径中没有拼写错误。如果你在命令行上输入idle,它应该可以工作。它不会立即弹出。第一次,可能需要等待 5 到 10 秒。一旦它“编译”了文件,它应该会快很多

© www.soinside.com 2019 - 2024. All rights reserved.