"Edit with IDLE" doesn't work any more ?

Peter Otten __peter__ at web.de
Fri Apr 28 08:48:05 EDT 2017

Yip, Kin wrote:

> I'm relatively new with Python3 in Windows 7.  I'm using now Python 3.6.1.
> Suddenly right-clicking on a .py file  and choose "Edit with IDLE" just
> doesn't work.
> I've tried to do :
> "c:\program files\python36\pythonw.exe"   -m idlelib    mypythoncodes.py
> the IDLE editor just doesn't come up.    But if I start the IDLE Shell and
> then "Open File", the editor is there and works normally.

IDLE shares its import mechanism with every other Python script. 

This results in the nasty quirk that if you have other .py files in the same 
directory as mypythoncodes.py, and one of these files has the same name as 
one of the modules in Python's standard library IDLE will try to run with 
your module rather than the one it actually needs. Common candidates are 
code.py or string.py, but there are many more. 

Once you rename or delete those files IDLE should start working again.

PS: Judging from the traceback in your answer to eryk sun in your case the 
offending module may be called tkinter.py

More information about the Python-list mailing list