pythy标准库之Tkinter(hello world窗口显示)
Tkinter :Tkinter,python内置的图形开发库GUI
python3.x中:
import tkinter #注意不要写成Tkinter,
一、用tkinter创建hello world窗口小程序
#!/usr/bin/python3
#-*-coding=utf-8-*- __author__='zkk' import tkinter as tk #导入tkinter库,为方便把它记为tk(tk=tkinter) window =tk.Tk() #生成一个窗口 label = tk.Label(window,text='Hello World!') #在这个窗口上显示'hello world'
label.config(cursor='gumby') #鼠标形状
label.config(width=20,height=10,fg='red',bg='yellow') #配置窗口的宽度和高度,以及字体颜色和背景颜色
label.config(font=('times','','bold')) #配置字体(类型,大小,黑体(italic-斜体)) label.pack()
window.mainloop()
将bold换成italic
效果图如下:(黑体和斜体)
21:22:45 2018-04-20 tkinter详细英语介绍
pythy标准库之Tkinter(hello world窗口显示)的更多相关文章
- python第六天 函数 python标准库实例大全
今天学习第一模块的最后一课课程--函数: python的第一个函数: 1 def func1(): 2 print('第一个函数') 3 return 0 4 func1() 1 同时返回多种类型时, ...
- Python 标准库一览(Python进阶学习)
转自:http://blog.csdn.net/jurbo/article/details/52334345 写这个的起因是,还是因为在做Python challenge的时候,有的时候想解决问题,连 ...
- Python中级 —— 07标准库
标准库学习 1. The Python Standard Library[https://docs.python.org/3.5/library/] ( 3.5.5 Documentation ) 1 ...
- Python常用的标准库以及第三方库有哪些?
20个必不可少的Python库也是基本的第三方库 读者您好.今天我将介绍20个属于我常用工具的Python库,我相信你看完之后也会觉得离不开它们.他们是: Requests.Kenneth Reitz ...
- Python常用的标准库以及第三方库
Python常用的标准库以及第三方库有哪些? 20个必不可少的Python库也是基本的第三方库 读者您好.今天我将介绍20个属于我常用工具的Python库,我相信你看完之后也会觉得离不开它们.他们 ...
- *#【Python】【基础知识】【模块】【tkinter】【学用tkinter画图/制作窗口】
Python 提供了多个图形开发界面的库,几个常用 Python GUI 库如下: Tkinter: Tkinter 模块(Tk 接口)是 Python 的标准 Tk GUI 工具包的接口 . Tk ...
- Python 常用的标准库以及第三方库有哪些?
作者:史豹链接:https://www.zhihu.com/question/20501628/answer/223340838来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明 ...
- Python标准库06 子进程 (subprocess包)
这里的内容以Linux进程基础和Linux文本流为基础.subprocess包主要功能是执行外部的命令和程序.比如说,我需要使用wget下载文件.我在Python中调用wget程序.从这个意义上来说, ...
- Python标准库与第三方库详解(转载)
转载地址: http://www.codeweblog.com/python%e6%a0%87%e5%87%86%e5%ba%93%e4%b8%8e%e7%ac%ac%e4%b8%89%e6%96%b ...
随机推荐
- SpringBoot 配置相关热启动
SpringBoot 配置相关热启动 参考网址1 参考网址2
- SQL 交叉连接与内连接
交叉连接 ,没有任何限制方式的连接. 叫做交叉连接. 碰到一种SQL 的写法. select * from t1,t2 . 这其实是交叉连接 . t1 是三条 , t2 是两条. ...
- do_mmap解读
1: unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, 2: unsigned long len, unsigned ...
- POJ1426-Find The Multiple-bfs
Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal repr ...
- Prometheus 安装与配置
下载Prometheus https://prometheus.io/download/ wget https://github.com/prometheus/prometheus/releases/ ...
- androidmanifest.xml 解码工具又来一发
背景: 最近这几天在研究facebook的协议,但是facebook的采用 SSL Pinning 技术,正常通过fiddler是不能解开SSL观察协议. 听说facebook app在 manife ...
- springCloud的使用07-----消息总线(spring cloud bus)
spring cloud bus 将分布式的节点用轻量的消息代理连接起来.可用于广播配置文件的更改或服务之间的通讯,也可以用于监控. spring cloud bus 默认只支持rabbitmq和ka ...
- CSS 清除浮动的几种方法
导读: CSS 的 Float(浮动),会使元素向左或向右移动,其周围的元素也会重新排列,Float(浮动),往往是用于图像,使得文字围绕图片的效果,而它在布局时一样非常有用.不过有利也有弊,使用浮动 ...
- 48.Course Schedule(课程安排)
Level: Medium 题目描述: There are a total of n courses you have to take, labeled from 0 to n-1. Some c ...
- Serilog 自定义 Enricher 来增加记录的信息
原文:Serilog 自定义 Enricher 来增加记录的信息 Serilog 自定义 Enricher 来增加记录的信息 Intro Serilog 是 .net 里面非常不错的记录日志的库,结构 ...