如何在 WINdows 10 中打开 Python IDLE(Shell 窗口)?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43159488/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I open Python IDLE (Shell WIndow) in WIndows 10?
提问by Khubaib Khawar
I am just starting to learn Python and I am using Windows 10. I downloaded and installed Python 3.4.3. But everytime I open Python from my Desktop or from C:\Python\python.exe it just opens a black command prompt without any Menu options like File menu, Edit Menu, Format Menu etc. I can't see any colors of the code, it's just black screen with white text. I searched about it on internet and came to know that what I am opening is the Editor winodws and I need to open Shell Window in order to have access to all of those options and features. I can't figure out where is the .exe of Shell Window and with what name is it? Please help me.
我刚开始学习 Python,我使用的是 Windows 10。我下载并安装了 Python 3.4.3。但是每次我从桌面或 C:\Python\python.exe 打开 Python 时,它只会打开一个黑色的命令提示符,没有任何菜单选项,如文件菜单、编辑菜单、格式菜单等。我看不到任何颜色的代码,它只是带有白色文本的黑屏。我在互联网上搜索了它并开始知道我打开的是编辑器 winodws,我需要打开 Shell Window 才能访问所有这些选项和功能。我不知道 Shell Window 的 .exe 在哪里以及它的名称是什么?请帮我。
P.S. I also tried to open pythonw.exe that was present in the Python folder where it was installed, but nothing opened.
PS我还尝试打开安装在Python文件夹中的pythonw.exe,但没有打开。
采纳答案by abccd
In Windows you will need to right click a .py, and press Edit to edit the file using IDLE. Since the default action of double clicking a .py is executing the file with python on a shell prompt.
在 Windows 中,您需要右键单击 .py,然后按 Edit 使用 IDLE 编辑文件。由于双击 .py 的默认操作是在 shell 提示符下使用 python 执行文件。
To open just IDLE:
只打开空闲:
Click on that. C:\Python36\Lib\idlelib\idle.bat
点击那个。 C:\Python36\Lib\idlelib\idle.bat
回答by Eric Alexander Silveira
Start menu > type IDLE (Python 3.4.3 <bitnum>-bit)
.
开始菜单 > 类型IDLE (Python 3.4.3 <bitnum>-bit)
。
Replace <bitnum>
with 32 if 32-bit, otherwise 64.
<bitnum>
如果是 32 位,则替换为 32,否则为 64。
Example:
例子:
IDLE (Python 3.6.2 64-bit)
空闲(Python 3.6.2 64 位)
I agree with one who says:
我同意一位说:
just type "IDLE" in the start-menu where it says "Type here to search" and press [{ENTER}]
只需在开始菜单中键入“IDLE”,其中显示“在此处键入以进行搜索”,然后按[{ ENTER} ]
回答by K p
If your using Windows 10 just type in idle
where it says: "Type here for search"
如果您使用的是 Windows 10,只需在其显示的idle
位置输入:“在此处输入以进行搜索”
回答by user2515235
My solution to setting options and then invoking Idle on a python script is:
我设置选项然后在 python 脚本上调用 Idle 的解决方案是:
Set optn=blah
...
Set optn=blah
start pythonw C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python36-32\Lib\idlelib\idle.py STFxlate.py
This allows you to setup the environment prior to invoking idle. This assumes that pythonw is in the current path
这允许您在调用 idle 之前设置环境。这假设 pythonw 在当前路径中