简体   繁体   中英

Where can I find WidgetRedirector in with Python3?

I was using a tkform( https://github.com/boscoh/tkform ) with Python2 and it was working perfectly. After switching to Python3, Im unable to run it, specifically the part:

from idlelib.WidgetRedirector import WidgetRedirector

It seems that WidgetRedirecor.py not even in the library (idellib) anymore...

Traceback (most recent call last):
  File "/Users/igor/opt/cymorph3/runCyMorphGUI.py", line 7, in <module>
    import tkform
  File "gui/tkform.py", line 22, in <module>
    from idlelib import WidgetRedirector
ImportError: cannot import name 'WidgetRedirector' from 'idlelib' (/Users/igor/opt/anaconda3/envs/cyMorph3/lib/python3.9/idlelib/__init__.py)

Can I fix it somehow?

Use:

from idlelib.redirector import WidgetRedirector

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM