Python Tkinter是什麼__Python

來源:互聯網
上載者:User
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 GUI 套件的標準Python介面。

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的底層介面,但是這些介面不能直接被應用程式所使用。它通常是一個共用庫(或者動態連結程式庫),在某些情況下可以被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模組提供的,最重要的介面就是Tkinter模組本身。想要使用Tkinter,所需要就是匯入Tkinter模組:

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:

大多數情況下使用from-in的格式可以安全的使用Tkinter模組,因為Tkinter模組僅僅匯入了組件類和相關常量。如果不想這樣做但又想少敲打一些字元,可以使用import-as:

import Tkinter as Tk

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.