Introduction to Programming Using Python——第9章 笔记

这篇博客介绍了Python的GUI编程库Tkinter,包括其基本概念、如何开始使用Tkinter、事件处理以及主要的Widget类。通过示例代码LISTING 9.1 SimpleGUI.py和9.3 ProcessButtonEventAlternativeCode.py,展示了如何创建和处理GUI事件。此外,还提到了Tkinter提供的各种组件,如Button, Checkbutton, Radiobutton, Label, Entry和Text等。" 116133911,493900,SpringBoot:使用RestController实现响应数据统一,"['Java', 'SpringBoot', 'Web开发', 'REST API', 'AOP']
摘要由CSDN通过智能技术生成

CHAPTER 9 

GUI PROGRAMMING USING TKINTER

9.1 Introduction

Tkinter (读作 T-K-Inter 是Tk interface的缩略),是Python自带的GUI库。

-----------------------------------------------------------------------------

9.2 Getting Started with Tkinter

LISTING 9.1 SimpleGUI.py

from tkinter import * # Import all definitions from tkinter

window = Tk() # Create a window
label = Label(window, text = "Welcome to Python") # Create a label
button = Button(window, text = "Click Me") # Create a button
label.pack() # Place the label in the window
button.pack() # Place the button in the window

window.mainloop() # Create an event loop

------------------------------------------------------------------------------

9.3 Processing Events

LISTING 9.3

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值