Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

First, I followed this answer to modify the file mimeapps.list.

How do I set IDLE as the default editor for Python scripts?

It works, but not perfect because everytime I right click .py file--select "Open With IDLE"--a python shell shows alongside the editor.

the following picture show the result of opening two .py files. enter image description here

Thanks in advance. enter image description here enter image description here

Update, as the IDLE appears in right-click menu, I donot run the commands:gksudo gedit /usr/share/applications/idle.desktop and Exec=/usr/bin/idle -n %f (no need to do this)

share|improve this question
AFAIK this is the normal IDLE behavior, it even opens the shell on Windows. – Javier Rivera Dec 26 '13 at 7:36
up vote 1 down vote accepted

Change the /usr/share/applications/idle.desktop file so at the Exec line it reads:

Exec=/usr/bin/idle -en

Or the better way would be to copy that file to ~/.local/share/applications and modify it there similarly, so after an update you won't have to reapply the changes.

But the above will modify IDLE-s opening behaviour even when you open it simply from the Dash/Launcher. If you don't want that, then you would have to make a copy of the idle.desktop file in the same directory (/usr/share/applications/ or ~/.local/share/applications/) , name it e.g idle.other.desktop, and modify the Exec line in that one, and also add a new line with the following content:


Then modify your mimeapps.list file, so the text/x-python= line reads:

share|improve this answer
I am not sure what idle.desktop is and how to edit it. I only find IDEL in /usr/share/applications. and I make a copy IDLE.other ,and run command gksudo gedit /usr/share/applications/idle.other.desktop, but only open a blank file, while gksudo gedit /usr/share/applications/idle.desktop can open a file with some setting options in it. why? – tcpiper Dec 26 '13 at 15:17
as open idle.other getting a blank file, there is no way for me to add NoDisplay=true – tcpiper Dec 26 '13 at 15:21
I can see it on your screenshot. There is an icon with the name IDLE, that is the idle.desktop file, but nautilus hides its extension. If you use terminal to check that directory, you will see. You have to open and edit that file with a text editor. – falconer Dec 26 '13 at 15:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.