What's Tkinter? 什么是 Tkinter?

Tkinter是Python的标准接口,用于访问由Scriptics(前Sun实验室)开发的Tk GUI工具箱。它在大多数Unix平台、Windows和Macintosh系统上可用,并自8.0版本起提供本地外观和感觉。Tkinter包括多个模块,其中_tkinter提供低级接口,不应直接由应用程序员使用。主要的公共接口是Tkinter模块本身。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The Tkinter module (“Tk interface”) is the standard Python interface to the Tk GUI toolkit from Scriptics (formerly developed by Sun Labs).

Tkinter(即Tk 接口)是标准的Python调用Tk GUI 工具箱的接口(由Sun 实验室开发).

Both Tk and Tkinter are available on most Unix platforms, as well as on Windows and Macintosh systems. Starting with the 8.0 release, Tk offers native look and feel on all platforms.

Tk 和Tkinter在大多数的Unix平台上都可以使用,就像在Windows和Macintosh(苹果)系统一样.从8.0版本开始,Tk在所有的平台上提供了原始的外观风格.

Tkinter consists of a number of modules. The Tk interface is provided by a binary extension module named _tkinter. This module contains the low-level interface to Tk, and should never be used directly by application programmers. It is usually a shared library (or DLL), but might in some cases be statically linked with the Python interpreter.

Tkinter 包含了一定数目的模块,Tk 接口由二进制扩展模块 _tkinter 提供.这个模块包含了一些低级的接口到Tk工具箱,并且应该不会被应用程序直接的使用.通常作为一个分享的库(或者动态链接库DLL), 但是可能在一些情况下会被python解释器静态的链接到.

The public interface is provided through a number of Python modules. The most important interface module is the Tkinter module itself. To use Tkinter, all you need to do is to import the Tkinter module:

这个公有的接口由一定的python模块提供.最重要的接口就是Tkinker的模块自己.为了使用Tkinker, 你需要引入这个Tkinker模块:

import Tkinter

Or, more often:或者更多情况下是这样使用:

from Tkinter import *

The Tkinter module only exports widget classes and associated constants, so you can safely use the from-in form in most cases. If you prefer not to, but still want to save some typing, you can use import-as:

为了方便我们可以这样:

import Tkinter as Tk

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值