在windows系统中,python使用messagebox时发生 AttributeError: module 'tkinter' has no attribute 'messagebox' 错误,解决方法为再单独导入messagebox模块即可解决报错。
#!/usr/bin/python
# -*- coding: utf-8 -*-
#导入tkinter模块
import tkinter
# 报错解决方法,再导入下面模块
from tkinter import messagebox