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.

Thanks in advance.

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)