如何在IDLE中打开.py文件进行编辑而不启动新的解释器会话?

时间:2022-09-29 17:07:01

Python for Windows has built in support for right clicking a .py file, and selecting, "edit with IDLE", instead of the usual action, which is running the file.

Python for Windows内置支持右键单击.py文件,并选择“使用IDLE编辑”,而不是正常运行该文件的操作。

How can I accomplish this same setup on Linux? I am running Mint Julia, a Debian-type distribution. Selecting my default program from the shortcut menu will only allow me to select idle3, which will open both an interpreter with a chevron, and the file I want to edit.

如何在Linux上完成相同的设置?我正在运行Mint Julia,一个Debian类型的发行版。从快捷菜单中选择我的默认程序只允许我选择idle3,它将打开带有V形符号的解释器和我想编辑的文件。

Can I set up my "open with idle" selection to forgo the interpreter, until I decide to run the file?

我可以设置“open with idle”选项以放弃解释器,直到我决定运行该文件?

Thanks.

谢谢。

2 个解决方案

#1


2  

In IDLE's menu, go to Options -> Configure IDLE... -> General. Under "At Startup" select "Open Edit Window" instead of "Open Shell Window", then hit Apply or Ok. IDLE will save this setting and from now on will open just an editor window when you open a file.

在IDLE的菜单中,转到选项 - >配置IDLE ... - >常规。在“启动时”下,选择“打开编辑窗口”而不是“打开外壳窗口”,然后单击应用或确定。 IDLE将保存此设置,从现在开始,打开文件时只会打开一个编辑器窗口。

#2


0  

You'll need to change the command to start IDLE itself to include a "-e". Choose "use a custom command" and type idle -e

您需要更改命令以启动IDLE本身以包含“-e”。选择“使用自定义命令”并键入idle -e

#1


2  

In IDLE's menu, go to Options -> Configure IDLE... -> General. Under "At Startup" select "Open Edit Window" instead of "Open Shell Window", then hit Apply or Ok. IDLE will save this setting and from now on will open just an editor window when you open a file.

在IDLE的菜单中,转到选项 - >配置IDLE ... - >常规。在“启动时”下,选择“打开编辑窗口”而不是“打开外壳窗口”,然后单击应用或确定。 IDLE将保存此设置,从现在开始,打开文件时只会打开一个编辑器窗口。

#2


0  

You'll need to change the command to start IDLE itself to include a "-e". Choose "use a custom command" and type idle -e

您需要更改命令以启动IDLE本身以包含“-e”。选择“使用自定义命令”并键入idle -e