📄 89.html
字号:
<tt ClasS="monofont">readline(),</tt> and <tt ClasS="monofont">readlines()</TT> methods, which allow you to take the given encoding of the object, and read as a Unicode string.</P>
</p>
<p><p><tT CLAss="monofont">codecs.stream_writer(file_object)</tt>棤
This is a class that supports encoding output to a stream. Objects created with this class carry the <TT CLass="monofont">write()</tT> and <TT Class="monofont">writelines()</tt> methods, which allow you to pass Unicode string to the object, and let the object translate them to the given<a name="idx1073743041"></a><a name="idx1073743042"></a> encoding on output.</p>
</p>
<P><p><b>unicodedata棤</B>
This<a naMe="idx1073743043"></a><a nAme="idx1073743044"></a> module provides access to the Unicode 3.0 database of character properties. The following functions are available:</P>
<P><TT clasS="monofont">unicodedata.category(u'P')</TT> returns the 2-character string 'Lu', the 'L'denoting it's a letter, and 'u'meaning that it's uppercase.</P>
<p><tt cLASS="monofont">unicodedata.bidirectional(u'\ x0660')</tt> returns 'AN', meaning that U+0660 is an Arabic number.</p>
</p>
<P><P><B>encodings棤</B>
This<a name="idx1073743045"></a><a name="idx1073743046"></a> is a package that supplies a wide collection of standard codecs. Currently, only the new Unicode support is provided.</p>
</p>
<p><p><b>distutils棤</b>
Package<a nAme="idx1073743047"></A><a naMe="idx1073743048"></a> of tools for distributing Python modules.</p>
</p>
<P><p><b>filecmp棤</b>
This <A NAMe="idx1073743049"></a><a nAME="idx1073743050"></A>module comes into place of both the <tt clASS="monofont">cmp.py,</Tt> the <tt cLASS="monofont">cmpcache.py</tt> and <tt class="monofont">dircmp.py</tt> modules.</p>
</p>
<p><p><b>gettext棤</b>
Provides<a naMe="idx1073743051"></a><A namE="idx1073743052"></a> an interface to the GNU gettext message catalog library in order to supply internationalization (I18N) and localization (L10N) support for Python programs.</p>
</p>
<p><P><b>imputil棤</b>
This<a NAME="idx1073743053"></a><a naME="idx1073743054"></A> module is an alternative API for writing customized import hooks in a simpler way. It is similar to the existing ihooks module.</P>
</p>
<p><p><b>linuxaudiodev棤</B>
Provides <A NAme="idx1073743055"></a><a NAME="idx1073743056"></a>audio for any platform that supports the Open Sound System (OSS). Most often, it is used to support the <tt class="monofont">/dev/audio</tt> device on Linux boxes. This module is identical to the already existing <tt class="monofont">sunaudiodev</tt> module.</p>
</P>
<p><p><B>mmap棤</b>
This <a nAme="idx1073743057"></a><a Name="idx1073743058"></A>module works on both Windows and Unix to treat a file as a memory buffer, making it possible to map a file directly into memory, and make it behave like a mutable string.</P>
</P>
<P><p><b>pyexpat棤</b>
This<a NAME="idx1073743059"></a><a naME="idx1073743060"></A> module is an interface to the Expat XML parser.</P>
</p>
<p><p><b>robotparser棤</B>
Initially <A NAme="idx1073743061"></a><a name="idx1073743062"></a>at <tt class="monofont">Tools/webchecker/,</tt> this module parses a <tt ClaSs="monofont">robots.txt</tt> file, which is used for writing web spiders.</P>
</p>
<p><p><b>sre棤</B>
This<a naME="idx1073743063"></A><A name="idx1073743064"></A> module is a new implementation for handling regular expressions. Although it is still very raw, its features include: faster mechanism, and support to unicode. The idea of the development team is to reimplement the re module using sre (without making changes to the re API).</P>
</P>
<P><p><b>tabnanny棤</b>
Originally <a NAME="idx1073743065"></a><a naME="idx1073743066"></A>at <Tt class="monofont">Tools/scripts/,</tt> this module checks Python sources for tab-width dependance (ambiguous indentation).</p>
</p>
<p><p><b>urllib2棤</b>
This<a name="idx1073743067"></a><A naMe="idx1073743068"></a> module is an experimental version of urllib, which will bring new and enhanced features, but will be incompatible with the current version.</p>
</P>
<p><p><b>UserString棤</b>
This<A namE="idx1073743069"></A><A Name="idx1073743070"></a> module exposes a base class for deriving objects from the string type.</P>
</P>
<P><P><b>xml棤</b>
This<a nAME="idx1073743071"></A><a namE="idx1073743072"></A> package covers the whole-new XML support and it is organized in three subpackages: xml.dom, xml.sax, and xml.parsers.</P>
</P>
<p><p><b>webbrowser棤</b>
A<a name="idx1073743073"></a><a name="idx1073743074"></a> module that provides a platform independent API to launch a web browser on a specific URL.</p>
</p>
<p><p><B>_winreg棤</b>
This<a Name="idx1073743075"></A><a namE="idx1073743076"></a> module works as an interface to the Windows registry. It contains an enhanced set of functions that has been part of PythonWin since 1995.</p>
</p>
<P><P><TT clasS="monofont">zipfile</TT>棤
This<A name="idx1073743077"></A><A NAme="idx1073743078"></a> module reads and writes zip-format archives (the format produced by PKZIP and zip applications. Not the one produced by the gzip program!).</p>
</P>
</BLOckquote>
</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, © 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="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>
</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="#idx1073743075">_winreg module</a><BR>
<a href="#idx1073743037">atexit module</a><BR>
<a href="#idx1073743039">codecs module</a> <a href="#idx1073743041">2nd</a><BR>
<a href="#idx1073743047">disutils module</a><BR>
<a href="#idx1073743045">encodings module</a><BR>
<a href="#idx1073743049">filecmp module</a><BR>
<a href="#idx1073743051">gettext module</a><BR>
<a href="#idx1073743053">imputil module</a><BR>
libraries<BR>
<a href="#idx1073743032">Undocumented Modules</a><BR>
<a href="#idx1073743055">linuxaudiodev module</a><BR>
<a href="#idx1073743057">mmap module</a><BR>
modules<BR>
<a href="#idx1073743076">_winreg</a><BR>
<a href="#idx1073743038">atexit</a><BR>
<a href="#idx1073743040">codecs</a> <a href="#idx1073743042">2nd</a><BR>
<a href="#idx1073743048">disutils</a><BR>
<a href="#idx1073743046">encodings</a><BR>
<a href="#idx1073743050">filecmp</a><BR>
<a href="#idx1073743052">gettext</a><BR>
<a href="#idx1073743054">imputil</a><BR>
<a href="#idx1073743056">linuxaudiodev</a><BR>
<a href="#idx1073743058">mmap</a><BR>
<a href="#idx1073743035">obsolete</a><BR>
<a href="#idx1073743060">pyexpat</a><BR>
<a href="#idx1073743062">robotparser</a><BR>
<a href="#idx1073743064">sre</a><BR>
<a href="#idx1073743066">tabnanny</a><BR>
<a href="#idx1073743034">Undocumented</a><BR>
<a href="#idx1073743044">unicodedata</a><BR>
<a href="#idx1073743068">urllib2</a><BR>
<a href="#idx1073743070">UserString</a><BR>
<a href="#idx1073743074">webbrowser</a><BR>
<a href="#idx1073743072">xml</a><BR>
<a href="#idx1073743078">zipfile</a><BR>
<a href="#idx1073743036">obsolete modules</a><BR>
<a href="#idx1073743059">pyexpat module</a><BR>
<a href="#idx1073743061">robotparser module</a><BR>
<a href="#idx1073743063">sre module</a><BR>
<a href="#idx1073743065">tabnanny module</a><BR>
<a href="#idx1073743033">Undocumented Modules</a><BR>
<a href="#idx1073743043">unicodedata module</a><BR>
<a href="#idx1073743067">urllib2 module</a><BR>
<a href="#idx1073743069">UserSTring module</a><BR>
<a href="#idx1073743073">webbrowser module</a><BR>
<a href="#idx1073743071">xml module</a><BR>
<a href="#idx1073743077">zipfile module</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 + -