I use eclipse + pydev for my Python development but I still like to use IDLE for simple tests, quickly banging out a simple script etc. So I want to be able to right click on a .py file and simply open it with IDLE. On Ubuntu this has not always been easy to achieve. Here is what worked on Ubuntu 13.10 (Saucy):
gksudo gedit /usr/share/applications/idle.desktop
Add a %f to the end of the line, and then save it. It should look like:
Exec=/usr/bin/idle -n %f
Then do the usual to associate .py files with IDLE so they automatically open when you double click them – namely, right click on any .py file, select Properties, then Open With, select IDLE and click on Set as default. Also see How do I set IDLE as the default editor for Python scripts?