📄 89.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 -> Undocumented Modules</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> > <a href="0672319942.html" class="navtitle">Python Developer's Handbook</a> > <a href="38.html" class="navtitle">3. Python Libraries</a> > <span class="nonavtitle">Undocumented Modules</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="88.html" title="Macintosh Specific"><font size="1">< BACK</font></a></td><td align=center width="70%" class="headingsubbarbg"><font size="1"><a href="popanote.asp?pubui=oreilly&bookname=0672319942&snode=89" target="_blank" title="Make a public or private annnotation">Make Note</a> | <a href="89.html" title="Use a Safari bookmark to remember this section">Bookmark</a></font></td><td align=right width="15%" class="headingsubbarbg"><a href="90.html" title="Summary"><font size="1">CONTINUE ></font></a></td></TR></TABLE>
<a href="5%2F31%2F2002+4%3A31%3A13+PM.html" TABINDEX="-1"><img src=images/spacer.gif border=0 width=1 height=1></a><font color=white size=1>152015024128143245168232148039199167010047123209178152124239215162147037129064192252024235</font><a href="read8.asp?bookname=0672319942&snode=89&now=5%2F31%2F2002+4%3A31%3A13+PM" TABINDEX="-1"><img src=images/spacer.gif border=0 width=1 height=1></a><br>
<FONT><h3>Undocumented Modules</h3>
<p>Currently, the modules listed in this section don't have any official documentation. However, you might find some information about them in this book, by browsing an updated version of the online library reference, or by checking some other Web site.</p>
<H4>Frameworks</H4>
<P>The next modules represent some Python frameworks that don't have any official documentation yet.</P>
<blocKQUOte>
<p><p><TT CLass="monofont">Tkinter</tt>棤
This module allows you to create GUIs (graphical user interfaces) because it implements an interface to the Tcl/Tk windowing libraries (see <a href="206.html">Chapter 15, "Tkinter,"</a> for details).</p>
</p>
<p><p><tt claSs="monofont">Tkdnd</tT>棤
This module provides drag-and-drop support for <tt cLass="monofont">Tkinter.</tT></p>
</p>
<p><P><TT Class="monofont">test</TT>棤
This package is responsible for the regression-testing framework.</P>
</P>
</blocKQUOte>
<h4>Miscellaneous Useful Utilities</h4>
<P>At this time this book went to press, the following modules didn't have any official documentation.<A NAme="idx1073743032"></a><a name="idx1073743033"></a><a name="idx1073743034"></a></p>
<h5><tt cLasS="monofont">dircmp</tt></h5>
<P>This module defines a class on which to build directory comparison tools.</p>
<h5><tt ClasS="monofont">tzparse</TT></H5>
<p>This module is an unfinished work to parse a time zone specification.</p>
<h5><tT CLAss="monofont">ihooks</tt></H5>
<P>The <TT clasS="monofont">ihooks</TT> module is a framework that manages the co-existence of different import routines.</P>
<h4>Platform Specific Modules</h4>
<p>These are implementation details of the <tt class="monofont">os</tt> module.</p>
<p><tt clasS="monofont">dospath,</tt>
<Tt clAss="monofont">macpath,</tt>
<Tt clASS="monofont">posixpath,</Tt>
<tt cLASS="monofont">ntpath</tt></p>
<p>These modules are for their platforms what the <TT CLass="monofont">os.path</tT> module is for the UNIX platform. They can all be used by any platform in order to handle pathnames of different platforms.</P>
<H4>Multimedia</H4>
<p>At the time this book went to press, the following modules didn't have any official documentation.</p>
<pre>
audiodev, sunaudio, toaiff
</pre>
<h4>Obsolete</h4>
<p>The following modules became <a name="idx1073743035"></a><a naMe="idx1073743036"></a>obsolete as of release 1.6:</P>
<p>stdwin, soundex, cml, cmpcache, dircache, dump, find, grep, packmail, poly, zmod, strop, util, and whatsound.</p>
<p>Note that release 2.0 hasn't made any module obsolete. All modules that were replaced were moved to the <Tt claSs="monofont">lib-old</tt> subdirectory of the distribution. That list, includes: cmp, cmpcache, dircmp, dump, find, grep, packmail, poly, util, whatsound, zmod.</P>
<H5><TT clasS="monofont">ni</TT></H5>
<p>Before version 1.5a4, the <tt cLASS="monofont">ni</tt> module was used to support <tt CLASs="monofont">import package</tt> statements.</p>
<h5><tt class="monofont">dump</tt></h5>
<p>The <tt clAss="monofont">dump</Tt> module prints the definition of a variable. Note that this module can be substituted for the <tt Class="monofont">pickle</Tt> module.</p>
<pRE>
>>> import dump
>>> var = (10, 20, 30, 40)
>>> dump.dumpvar("newvar", var)
newvar = (10, 20, 30, 40)
</PRe>
<h4>Extension Modules</h4>
<p>The following modules are obsolete tools to support GUI implementations.</P>
<BLOckquOTE>
<P><p><tt cLASS="monofont">stdwin</tt>棤
This module provides an interface to the obsolete <tt class="monofont">STDWIN.</tt>
<tt class="monofont">STDWIN</tt> is an unsupported platform-independent GUI interface that was replaced by <Tt cLass="monofont">Tkinter.</Tt></p>
</p>
<p><P><tt cLASS="monofont">stdwinevents</tt>棤
Interacts with the <tt CLASs="monofont">stdwin</tt> module by providing <tT CLAss="monofont">piping</tt> services.</P>
</P>
</BLockquote>
<h4>New Modules on Python 2.0</h4>
<p>Next, you a have a list of new modules that were introduced to Python recently. As always, I suggest you take a look at the 2.0 documentation for details about any given module.</p>
<blockquoTe>
<p><P><b>atexit棤</b>
Registers <a Name="idx1073743037"></a><A namE="idx1073743038"></A>functions to be called when Python exits. If you already use the function <TT clasS="monofont">sys.exitfunc(),</TT> you should change your code to import <Tt claSS="monofont">atexit,</TT> and call the function <tt clASS="monofont">atexit.register(),</Tt> passing as an argument the function that you want to call on exit.</p>
</p>
<p><p><b>codecs棤</b>
Provides<a name="idx1073743039"></a><a name="idx1073743040"></a> support (base classes) for Unicode encoders and decoders, and provides access to Python's codec registry. You can use the functions provided by this module to search for existing encodings, or to register new ones. Most frequently, you will adhere to the function <tT clAss="monofont">codecs.lookup(encoding),</tT> which returns a 4-function tuple: (encoder, decoder, stream_reader, stream_writer). This module along with the unicodedata module was added as part of the new Unicode support to Python 2.0. The <tt clAss="monofont">condec</tT> class defines the interface for stateless encoders and decoders. The following functions and classes are also available in this module.</P>
</P>
<P><p><tt cLASS="monofont">codec.encode()</tt>棤
Takes a Unicode string, and returns a 2-tuple (8-bit-string, length). The length part of the tuple shows how much of the Unicode string was converted.</p>
</p>
<P><P><TT clasS="monofont">codec.decode()</TT>棤
Takes an 8-bit string, and returns a 2-tuple (ustring, length). The length part of the tuple shows how much of the 8-bit string was consumed.</P>
</p>
<p><p><tt class="monofont">codecs.stream_reader(file_object)</tt>棤
This is a class that supports decoding input from a stream. Objects created with this class carry the <tt class="monofont">read(),</tT>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -