(windows下)python2.x有关Tkinter,simpledialog,messagebox的问题
2015-11-18 19:35
555 查看
(windows下)python2.x有关Tkinter,simpledialog,messagebox的问题
python3是tkinter,python2中是Tkinter
#python2下
from Tkinter import *
import tkSimpleDialog as dl
import tkMessageBox as mb
root=Tk()
w=Label(root,text="Label Title")
w.pack()
mb.showinfo("welcome","Welcome Message")
guess=dl.askinteger("Number","Enter a number")
output='This is output message'
mb.showinfo("Output:",output)
官方文档地址:https://docs.python.org/2/library/tkinter.html#module-Tkinter
python3是tkinter,python2中是Tkinter
#python2下
from Tkinter import *
import tkSimpleDialog as dl
import tkMessageBox as mb
root=Tk()
w=Label(root,text="Label Title")
w.pack()
mb.showinfo("welcome","Welcome Message")
guess=dl.askinteger("Number","Enter a number")
output='This is output message'
mb.showinfo("Output:",output)
官方文档地址:https://docs.python.org/2/library/tkinter.html#module-Tkinter
相关文章推荐
- Python动态类型的学习---引用的理解
- Python3写爬虫(四)多线程实现数据爬取
- 垃圾邮件过滤器 python简单实现
- 下载并遍历 names.txt 文件,输出长度最长的回文人名。
- install and upgrade scrapy
- Scrapy的架构介绍
- Centos6 编译安装Python
- 使用Python生成Excel格式的图片
- 如何重装TCP/IP协议
- 让Python文件也可以当bat文件运行
- [Python]推算数独
- Python中zip()函数用法举例
- Python中map()函数浅析
- Python将excel导入到mysql中
- Windows 8 官方高清壁纸欣赏与下载
- 谁是桌面王者?Win PK Linux三大镇山之宝
- 对《大家都在点赞 Windows Terminal,我决定给你泼一盆冷水》一文的商榷