Do you want to create a graphic user interface for your Python program? You should learn how to use Tkinter! Tkinter is the most common way to add GUIs to Python programs.
您是否要为Python程序创建图形用户界面? 您应该学习如何使用Tkinter! Tkinter是将GUI添加到Python程序的最常用方法。
Tkinter provides an object-oriented interface to the Tk GUI toolkit that is built-in to Python. You don't even have to install anything extra to use Tkinter.
Tkinter为Python内置的Tk GUI工具箱提供了一个面向对象的界面。 您甚至不必安装任何其他东西即可使用Tkinter。
Tkinter makes it simple to create a GUI which handles user input and output. A GUI uses a form of object oriented programming called "event-driven." This means that the program responds to events, which are actions that a user takes.
Tkinter使创建用于处理用户输入和输出的GUI变得简单。 GUI使用一种称为“事件驱动”的面向对象编程的形式。 这意味着程序会响应事件,这是用户采取的操作。
John Elder from Codemy.com created a 5.5 hour long comprehensive course about how to use Tkinter. We have released the full course for free on the freeCodeCamp.org YouTube channel.
来自Codemy.com的 John Elder创建了一个长达5.5小时的综合课程,内容涉及如何使用Tkinter。 我们已经在freeCodeCamp.org YouTube频道上免费发布了完整的课程。
Here is what the course covers:
这是本课程涵盖的内容:
- What is Tkinter? 什么是Tkinter?
- Positioning with Tkinter's Grid System 用Tkinter的网格系统定位
- Creating Buttons 创建按钮
- Creating Input Fields 创建输入字段
- Building a Simple Calculator App 构建一个简单的计算器应用程序
- Using Icons, Images, and Exit Buttons 使用图标,图像和退出按钮
- Building an Image Viewer App 生成图像查看器应用
- Adding a Status Bar 添加状态栏
- Adding Frames 添加框架
- Using Radio Buttons 使用单选按钮
- Adding Message Boxes 添加消息框
- Creating New Windows 建立新视窗
- Opening Files Dialog Boxes 打开文件对话框
- Using Sliders 使用滑杆
- Using Checkboxes 使用复选框
- Using Dropdown Menus 使用下拉菜单
- Using Databases 使用数据库
- Building a GUI for a Database App 为数据库应用程序构建GUI
- Deleting a Record From a Database 从数据库删除记录
- Updating a Record with SQLite 使用SQLite更新记录
- Building a Weather App 构建天气应用
- Using Matplotlib Charts 使用Matplotlib图表
Watch the course below or on the freeCodeCamp.org YouTube channel (5.5 hour watch).
在下面的课程中或在freeCodeCamp.org YouTube频道上观看(5.5小时观看)。
翻译自: https://www.freecodecamp.org/news/learn-how-to-use-tkinter-to-create-guis-in-python/