If I double click on a Python file on my Gnome Classic desktop, it is not opened in IDLE. How can I make IDLE the default editor for Python files?
-
I have tried to delete all the other programs that were being opened.
-
I have been looking through IDLE's properties.
-
I have been looking through the program's properties as well.
When I run
xdg-mime query default text/x-python
I get the output
gedit.destkop
I do have IDLE installed, and I tried to right click the file and open with an application. IDLE was nowhere to be seen. But when I go to my applications, and go to programming, IDLE is there, clear as day.
Best Answer
You can easily associate the
.py
files with IDLE. You have to right click a python script, choose "Open with -> Other application", then choose IDLE from the list with the checkbox asking if it should be the default application ticked. I use XFCE, but Gnome's Nautilus should be similar.Alternatively, there is a configuration file in your home directory which contains the list of default applications. You can access it on the following path:
You can extend it with the following line:
where
idle.desktop
stands for the desktop file of the IDLE version you would like to use, for instanceidle-python2.7.desktop
oridle-python3.desktop
based on the python version you have to use.NOTE:
Be aware of the permissions of your scripts. If it has the executable permission, despite the default application, your system won't open it in IDLE, as it will try to execute it.