What's Tkinter? 什么是 Tkinter?

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

猜你喜欢

转载自blog.csdn.net/CarlBenjamin/article/details/82953079
今日推荐