1.Python GUI之tkinter介绍
Python 介绍 GUI tkinter
2023-09-11 14:21:23 时间
from tkinter import Tk
#1.显示窗口
my_window=Tk()
#标题
my_window.title("我的窗口")
#设置窗口居中
#获取整个屏幕大小
screen_width, screen_height = my_window.maxsize()
#设置窗口大小
width=240
height=480
# align_str="%dx%d" % (width, height)
align_str="%dx%d+%d+%d" % (width, height,(screen_width-width)/2,(screen_height-height)/2)
#设置窗口的宽、高
my_window.geometry(align_str)
#设置窗口是否可以缩放 True表示可缩放 False表示不可缩放
my_window.resizable(width=True, height=False)
my_window.mainloop()
相关文章
- 【Python成长之路】python并发学习:多进程与多线程的用法及场景介绍
- Python 日期和时间_python 当前日期时间_python日期格式化
- [Python] Generating random numbers using numpy lib
- Python中函数的参数传递与可变长参数
- Python语言学习之打印输出那些事:python输出图表和各种吊炸天的字符串或图画、版权声明(如README.md)等之详细攻略
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(Entry/Entry的Command)
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(Listbox/Scrollbar)
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(Scale/Scale的Command)
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(Button展示图片事件)
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(text.insert/link各种事件)
- Python编程语言学习:python的列表的特殊应用之一行命令实现if判断中的两类判断
- Python语言学习:复杂函数(yield/@property)使用方法、案例应用之详细攻略
- Python语言学习之字符串那些事:python和字符串的使用方法之详细攻略
- 已解决Visit python.org to download an earlier version of Python.
- 〖Python 数据库开发实战 - Python与Redis交互篇④〗- 利用 redis-py 实现集合与有序集合的常用指令操作
- Python开发GUI工具介绍,实战:将图片转化为素描画!
- 【全网最全】深度盘点 Python 日期时间处理操作
- 【阶段四】Python深度学习05篇:深度学习项目实战:卷积神经网络的定义、卷积网络的结构与卷积层的原理
- python编程:graphviz库绘制流程图
- Python使用redis介绍
- Python简单实现邮件群发
- python爬虫
- Python GUI设计——Python语言介绍
- python简单介绍及基础知识(二)
- Python: 爬虫入门-python爬虫入门教程(非常详细)
- 强化学习笔记:马尔科夫链介绍及基于Python的蒙特卡洛仿真
- Python语言基础学习之Python基础之列表介绍和循环遍历