Terry J. Reedy added the comment:
Steve is correct. lib/code.py is used for IDLE's Shell.
One should generally avoid naming files the same as stdlib files. To do so,
one can either look in the module index of the docs or try 'import somename'.
When Python starts, it imports the modules it us
Steve Dower added the comment:
I assume this is because Idle is doing "import code" somewhere and picking up
your file instead of the real one.
Renaming the file to not conflict with the standard library is an immediate
workaround, but perhaps Idle should do some sys.path protection around whe
New submission from Christian Wüste:
As soon as I specify a file "code.py", it can not be opened via the right click
> Edit with IDLE 3.6 (64-Bit).
The content of the file is completely irrelevant.
All other Python files located in the same folder as "code.py" can not be
opened.
If I rename the