⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 202.html

📁 Python Ebook Python&XML
💻 HTML
字号:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Robots" content="INDEX,NOFOLLOW">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<TITLE>Safari | Python Developer's Handbook -&gt; The Tkinter Module</TITLE>
<LINK REL="stylesheet" HREF="oreillyi/oreillyN.css">
</HEAD>
<BODY bgcolor="white" text="black" link="#990000" vlink="#990000" alink="#990000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="100%" cellpadding=5 cellspacing=0 border=0 class="navtopbg"><tr><td><font size="1"><p class="navtitle"><a href="8.html" class="navtitle">Web Development</a> &gt; <a href="0672319942.html" class="navtitle">Python Developer's Handbook</a> &gt; <a href="199.html" class="navtitle">14. Python and GUIs</a> &gt; <span class="nonavtitle">The Tkinter Module</span></p></font></td><td align="right" valign="top" nowrap><font size="1"><a href="main.asp?list" class="safnavoff">See All Titles</a></font></td></tr></table>
<TABLE width=100% bgcolor=white border=0 cellspacing=0 cellpadding=5><TR><TD>
<TABLE border=0 width="100%" cellspacing=0 cellpadding=0><TR><td align=left width="15%" class="headingsubbarbg"><a href="201.html" title="Python GUI Toolkits"><font size="1">&lt;&nbsp;BACK</font></a></td><td align=center width="70%" class="headingsubbarbg"><font size="1"><a href="popanote.asp?pubui=oreilly&bookname=0672319942&snode=202" target="_blank" title="Make a public or private annnotation">Make Note</a> | <a href="202.html" title="Use a Safari bookmark to remember this section">Bookmark</a></font></td><td align=right width="15%" class="headingsubbarbg"><a href="203.html" title="Overview of Other GUI Modules"><font size="1">CONTINUE&nbsp;&gt;</font></a></td></TR></TABLE>
<a href="5%2F31%2F2002+4%3A47%3A37+PM.html" TABINDEX="-1"><img src=images/spacer.gif border=0 width=1 height=1></a><font color=white size=1>152015024128143245168232148039199167010047123209178152124239215162148043124057188182108097</font><a href="read5.asp?bookname=0672319942&snode=202&now=5%2F31%2F2002+4%3A47%3A37+PM" TABINDEX="-1"><img src=images/spacer.gif border=0 width=1 height=1></a><br>
<FONT>
				<h3>




The Tkinter Module</h3>
				<p>Tkinter is Python's <i>de facto</I> standard GUI
toolkit. It's the most cross-platform GUI. Many applications are written using
Tkinter because it is a very powerful and flexible tool. Maybe the most notable
features are its geometry management, which is much better than standard
windows, and its efficient Text and Canvas widgets. Many toolkits support as
good as or better geometry management (some of them are listed in this
chapter).</P>

				<P>Tkinter, which stands for <I>Tk interface,</i> is the
standard Python interface to the Tk GUI toolkit from 
<a naME="idx1073748179"></A>Ajuba (formerly 
<A name="idx1073748180"></A>Scriptics). Tkinter is a binding to Tcl/Tk that in former
days was developed by Sun Labs. Actually it works on top of Tcl/Tk. To use
Tkinter, you don't need to write Tcl code. Occasionally, you will need to
consult the Tk documentation and the Tcl documentation because Tk's low-level
event handling mechanism is considered part of Tcl.</P>

				<P>Both Tk and Tkinter are available on most UNIX platforms, as well
as on Windows and Macintosh systems. Some platforms come with Tcl/Tk as an
optional part of the OS distribution or, in the case of Win32, as part of the
Python install. Quite a lot of Linux distributions (and other free UNIX-like
Operation Systems) install Tcl/Tk by default. Starting with the 8.0 release, Tk
offers a native look and feel on all platforms.</P>

				<p>If you ask yourself why you should use Tkinter, I would say that it
is a mature and reliable solution for graphic applications, running on every
platform where it is possible to run Tcl/Tk, which is basically every platform,
but Macintosh. Tkinter and Macs are still negotiating a healthy version.</p>

				<p>One of the most important reasons why Tkinter was chosen to be the
official GUI option is because it seems to have a long life ahead of it. Many
people are against this, but the fact is that Tkinter is available for Windows,
UNIX, and Macintosh platforms, and being part of the Official Python
distribution puts it in a position of constant upgrading.</p>

				<p>Tkinter is probably the most documented Python GUI that you will
find. As you can see in 
<a href="206.html">Chapter 15</a>, there is a respectable
knowledge base available for you, given its <i>de facto</i>
standard status.</p>

				<p>See the Tkinter documentation page on 
<a targEt="_blank" hRef="http://www.python.org/">http://www.python.org/</a> for
more up-to-date information about this toolkit.
<A name="idx1073748181"></A>
					<a naME="idx1073748182"></A>
					<A name="idx1073748183"></A>
					<A NAme="idx1073748184"></a>
					<a NAME="idx1073748185"></a>
				</p>

			</foNT>
<P><TABLE width="100%" border=0><TR valign="top"><TD><font size=1 color="#C0C0C0"><br></font></TD><TD align=right><font size=1 color="#C0C0C0">Last updated on 1/30/2002<br>Python Developer's Handbook, &copy;&nbsp;2002 Sams Publishing</font></TD></TR></TABLE></P>
<TABLE border=0 width="100%" cellspacing=0 cellpadding=0><TR><td align=left width="15%" class="headingsubbarbg"><a href="201.html" title="Python GUI Toolkits"><font size="1">&lt;&nbsp;BACK</font></a></td><td align=center width="70%" class="headingsubbarbg"><font size="1"><a href="popanote.asp?pubui=oreilly&bookname=0672319942&snode=202" target="_blank" title="Make a public or private annnotation">Make Note</a> | <a href="202.html" title="Use a Safari bookmark to remember this section">Bookmark</a></font></td><td align=right width="15%" class="headingsubbarbg"><a href="203.html" title="Overview of Other GUI Modules"><font size="1">CONTINUE&nbsp;&gt;</font></a></td></TR></TABLE>
</TD></TR></TABLE>
<br><TABLE width=100% bgcolor=white border=0 cellspacing=0 cellpadding=5><TR><TD><H4 class=Title>Index terms contained in this section</H4>
<font size=2>
 <a href="#idx1073748179">Ajuba</a><BR>
graphical user interfaces (GUIs)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;toolkits<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#idx1073748181">Tkinter</a><BR>
interfaces<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;graphical user (GUI)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#idx1073748182">toolkits;Tkinter</a><BR>
modules<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#idx1073748185">Tkinter</a><BR>
 <a href="#idx1073748180">Scriptics</a><BR>
 <a href="#idx1073748184">Tkinter module</a><BR>
toolkits<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;graphical user interfaces (GUIs)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#idx1073748183">Tkinter</a><BR>
<BR>
</font></TD></TR></TABLE>




<!--EndOfBrowse-->

</TD></TR></TABLE>
<table width=100% border=0 cellspacing=0 cellpadding=0 bgcolor=#990000><tr><td><p align=center><font size=1 face="verdana,arial,helvetica" color=white>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -