I'm using ubuntu 14.04 LTS and I have installed both python 2.7 and python 3.4 . I have tried everything here How do I set IDLE as the default editor for Python scripts? but its not working. Can some please help me I want to make the IDLE the default program to open my python scripts and if possible to set it for both python2 and python3. Thank you
After a few days of trial and error I found the answer to my question. I decided to post my solution to my question because it might help someone who is experiencing the same problem. Here are the steps that I followed.
- Open the terminal crt+alt+t
- Under [Added Associations] list add
text/x-python=idle-python2.7.desktop;entry must be the first line of the [Added Associations] list
- Under the [Default Applications] add
text/x-python=idle-python2.7.desktopthis must also be the first line.
- Note the [Default Applications] entry does not have a ; at the end
- If you have python3 substitute idle-python2.7.desktop by idle-python3.4.desktop
What I'm yet to figure out is how to open a python3 script with the IDLE3 and a python2 script with IDLE2 in computers that have both python versions installed like mine. Currently with my solution both python3 and python2 scripts will open with the same IDLE. For example I have a scrip1.py which I programmed with python3 and script2.py which I programmed with python2 both of this scripts will open with the IDLE that a write on the mimeapps list. If i write
text/x-python=idle-python2.7.desktop; they both open with IDLE2 and if i write
text/x-python=idle-python2.7.desktop; and also
text/x-python=idle-python3.4.desktop; IDLE3 will take preferrence and both script1.py and script2.py will open with IDLE3.
I Hope thats clear and if anyone can help me to solve this problem it would be much appreciated.Thank You