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

Terry Reedy tjreedy at udel.edu
Fri Apr 28 15:19:54 EDT 2017


On 4/28/2017 9:01 AM, eryk sun wrote:
> On Fri, Apr 28, 2017 at 12:32 PM, Yip, Kin <kinyip at bnl.gov> wrote:
>> Traceback (most recent call last):
>>    File "c:\Program Files\Python36\lib\idlelib\pyshell.py", line 4, in <module>
>>      from tkinter import *
>>    File "C:\Users\kinyip\Desktop\Python Codes\tkinter.py", line 1, in <module>
>>      from turtle import *
>>    File "c:\Program Files\Python36\lib\turtle.py", line 116, in <module>
>>      from tkinter import simpledialog
>> ImportError: cannot import name 'simpledialog'
> 
> The traceback tells you what you need to know. See how importing
> tkinter used your "Python Codes\tkinter.py".
> 
> The first part of this problem is that "Edit with IDLE" is executed as
> `pythonw.exe -m idlelib "%L" %*`. The -m command-line option adds the
> working directory (not the script directory) to the head of sys.path.
> The second part is that Explorer starts the process with the working
> directory set to the parent directory of the "%L" target file. The 3rd
> part is that you have a file in that directory named tkinter.py.
> Overall this is a bad experience for beginners, and I know Terry Reedy
> is working to improve this.

There is an issue to fix this.
https://bugs.python.org/issue26143
I added a note mentioning this report.

-- 
Terry Jan Reedy



More information about the Python-list mailing list