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

Yip, Kin kinyip at bnl.gov
Fri Apr 28 08:47:58 EDT 2017


Hi,

I've finally known why ....  By chance, I went to the installation directory : C:\Program Files\Python36\Lib\tkinter   

to check on files.  I did "EDIT with IDLE" on any files there.  It all works !   Then, I went back to my directory
where I put all my personal .py codes.  It didn't work there.   Finally, I've guessed and realized/tested that
"EDIT with IDLE"  doesn't work in my python directory because I have just recently made a file called :

tkinter.py


Somehow, this stops "EDIT with IDLE" from working if I try to "EDIT with IDLE" on any files in that directory/folder.

After I rename it to mytkinter.py , things work normally now ! 

Weird !    Don't know exactly why ...?!   

Sorry to bother you guys ...

Kin

-----Original Message-----
From: Python-list [mailto:python-list-bounces+kinyip=bnl.gov at python.org] On Behalf Of Yip, Kin
Sent: Friday, April 28, 2017 8:33 AM
To: eryk sun <eryksun at gmail.com>; python-list at python.org
Subject: RE: "Edit with IDLE" doesn't work any more ?

Hi Eryk,

If I do:

"c:\Program Files\Python36\python.exe"  -m idlelib beersong.py

I see the following :

=======================
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'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Program Files\Python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\Program Files\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\Program Files\Python36\lib\idlelib\__main__.py", line 6, in <module>
    import idlelib.pyshell
  File "c:\Program Files\Python36\lib\idlelib\pyshell.py", line 7, in <module>
    "Your Python may not be configured for Tk. **", file=sys.__stderr__)
NameError: name 'sys' is not defined
========================================================================================


Any suggestion ?

Kin

-----Original Message-----
From: eryk sun [mailto:eryksun at gmail.com] 
Sent: Friday, April 28, 2017 8:27 AM
To: python-list at python.org
Cc: Yip, Kin <kinyip at bnl.gov>
Subject: Re: "Edit with IDLE" doesn't work any more ?

On Fri, Apr 28, 2017 at 12:04 PM, Yip, Kin <kinyip at bnl.gov> wrote:
>
> I've tried to do :
>
> "c:\program files\python36\pythonw.exe"   -m idlelib    mypythoncodes.py

Change this to use "python.exe" and run it from a command prompt. This way you can see the traceback if an exception is raised.
-- 
https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list