首页 > 代码库 > python--DenyHttp项目(1)--GUI:tkinter? module 'tkinter' has no attribute 'messagebox'

python--DenyHttp项目(1)--GUI:tkinter? module 'tkinter' has no attribute 'messagebox'

AttributeError: module ‘tkinter‘ has no attribute ‘messagebox‘

improt tkinter

from tkinter import *

import tkinter as tk

以上三种尝试之后,都没有解决问题,最后查找了python安装目录的tkinter模块,确实找到了messagebox.py

于是:

from tkinter import messageox

问题解决

python--DenyHttp项目(1)--GUI:tkinter? module 'tkinter' has no attribute 'messagebox'