[Tkinter-discuss] No module named tkMessageBox in python3.2??

Firat Ozgul ozgulfirat at gmail.com
Mon Aug 22 08:14:45 CEST 2011


tkMessageBox has been renamed to messagebox in Python 3.x. Also this
module is not available in tkinter. Therefore:

[code]
>>> from tkinter import messagebox
>>> messagebox.showwarning("hello", "world")
[/code]

2011/8/22 守株待兔 <1248283536 at qq.com>:
> python3.2
> Python 3.2 (r32:88445, Mar 25 2011, 19:28:28)
> [GCC 4.5.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from tkMessageBox import askokcancel
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: No module named tkMessageBox
>
> python
> Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
> [GCC 4.5.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from tkMessageBox import askokcancel
>>>>
> it's ok in python2.7
>
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
>
>


More information about the Tkinter-discuss mailing list