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

📄 module-cursesascii.html

📁 一本很好的python的说明书,适合对python感兴趣的人
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<P>
<dl><dt><b><a name='l2h-1318'><tt class='function'>isblank</tt></a></b> (<var>c</var>)
<dd>
Checks for an ASCII whitespace character.
</dl>

<P>
<dl><dt><b><a name='l2h-1319'><tt class='function'>iscntrl</tt></a></b> (<var>c</var>)
<dd>
Checks for an ASCII control character (in the range 0x00 to 0x1f).
</dl>

<P>
<dl><dt><b><a name='l2h-1320'><tt class='function'>isdigit</tt></a></b> (<var>c</var>)
<dd>
Checks for an ASCII decimal digit, "<tt class="character">0</tt>" through
"<tt class="character">9</tt>".  This is equivalent to "<tt class="samp"><var>c</var> in string.digits</tt>".
</dl>

<P>
<dl><dt><b><a name='l2h-1321'><tt class='function'>isgraph</tt></a></b> (<var>c</var>)
<dd>
Checks for ASCII any printable character except space.
</dl>

<P>
<dl><dt><b><a name='l2h-1322'><tt class='function'>islower</tt></a></b> (<var>c</var>)
<dd>
Checks for an ASCII lower-case character.
</dl>

<P>
<dl><dt><b><a name='l2h-1323'><tt class='function'>isprint</tt></a></b> (<var>c</var>)
<dd>
Checks for any ASCII printable character including space.
</dl>

<P>
<dl><dt><b><a name='l2h-1324'><tt class='function'>ispunct</tt></a></b> (<var>c</var>)
<dd>
Checks for any printable ASCII character which is not a space or an
alphanumeric character.
</dl>

<P>
<dl><dt><b><a name='l2h-1325'><tt class='function'>isspace</tt></a></b> (<var>c</var>)
<dd>
Checks for ASCII white-space characters; space, tab, line feed,
carriage return, form feed, horizontal tab, vertical tab.
</dl>

<P>
<dl><dt><b><a name='l2h-1326'><tt class='function'>isupper</tt></a></b> (<var>c</var>)
<dd>
Checks for an ASCII uppercase letter.
</dl>

<P>
<dl><dt><b><a name='l2h-1327'><tt class='function'>isxdigit</tt></a></b> (<var>c</var>)
<dd>
Checks for an ASCII hexadecimal digit.  This is equivalent to
"<tt class="samp"><var>c</var> in string.hexdigits</tt>".
</dl>

<P>
<dl><dt><b><a name='l2h-1328'><tt class='function'>isctrl</tt></a></b> (<var>c</var>)
<dd>
Checks for an ASCII control character (ordinal values 0 to 31).
</dl>

<P>
<dl><dt><b><a name='l2h-1329'><tt class='function'>ismeta</tt></a></b> (<var>c</var>)
<dd>
Checks for a non-ASCII character (ordinal values 0x80 and above).
</dl>

<P>
These functions accept either integers or strings; when the argument
is a string, it is first converted using the built-in function
<tt class="function">ord()</tt>.

<P>
Note that all these functions check ordinal bit values derived from the 
first character of the string you pass in; they do not actually know
anything about the host machine's character encoding.  For functions 
that know about the character encoding (and handle
internationalization properly) see the <tt class='module'><a href="module-string.html" tppabs="http://www.python.org/doc/current/lib/module-string.html">string</a></tt> module.

<P>
The following two functions take either a single-character string or
integer byte value; they return a value of the same type.

<P>
<dl><dt><b><a name='l2h-1330'><tt class='function'>ascii</tt></a></b> (<var>c</var>)
<dd>
Return the ASCII value corresponding to the low 7 bits of <var>c</var>.
</dl>

<P>
<dl><dt><b><a name='l2h-1331'><tt class='function'>ctrl</tt></a></b> (<var>c</var>)
<dd>
Return the control character corresponding to the given character
(the character bit value is bitwise-anded with 0x1f).
</dl>

<P>
<dl><dt><b><a name='l2h-1332'><tt class='function'>alt</tt></a></b> (<var>c</var>)
<dd>
Return the 8-bit character corresponding to the given ASCII character
(the character bit value is bitwise-ored with 0x80).
</dl>

<P>
The following function takes either a single-character string or
integer value; it returns a string.

<P>
<dl><dt><b><a name='l2h-1333'><tt class='function'>unctrl</tt></a></b> (<var>c</var>)
<dd>
Return a string representation of the ASCII character <var>c</var>.  If
<var>c</var> is printable, this string is the character itself.  If the
character is a control character (0x00-0x1f) the string consists of a
caret ("<tt class="character">^</tt>") followed by the corresponding uppercase letter.
If the character is an ASCII delete (0x7f) the string is
<code>'^?'</code>.  If the character has its meta bit (0x80) set, the meta
bit is stripped, the preceding rules applied, and
"<tt class="character">!</tt>" prepended to the result.
</dl>

<P>
<dl><dt><b><a name='l2h-1334'><tt>controlnames</tt></a></b>
<dd>
A 33-element string array that contains the ASCII mnemonics for the
thirty-two ASCII control characters from 0 (NUL) to 0x1f (US), in
order, plus the mnemonic "<tt class="samp">SP</tt>" for the space character.
</dl>

<DIV CLASS="navigation"><p><hr><table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td><A href="module-curses.wrapper.html" tppabs="http://www.python.org/doc/current/lib/module-curses.wrapper.html"><img src="previous.gif" tppabs="http://www.python.org/doc/current/icons/previous.gif" border="0" height="32"
  alt="Previous Page" width="32"></A></td>
<td><A href="allos.html" tppabs="http://www.python.org/doc/current/lib/allos.html"><img src="up.gif" tppabs="http://www.python.org/doc/current/icons/up.gif" border="0" height="32"
  alt="Up One Level" width="32"></A></td>
<td><A href="module-getopt.html" tppabs="http://www.python.org/doc/current/lib/module-getopt.html"><img src="next.gif" tppabs="http://www.python.org/doc/current/icons/next.gif" border="0" height="32"
  alt="Next Page" width="32"></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td><A href="contents.html" tppabs="http://www.python.org/doc/current/lib/contents.html"><img src="contents.gif" tppabs="http://www.python.org/doc/current/icons/contents.gif" border="0" height="32"
  alt="Contents" width="32"></A></td>
<td><a href="modindex.html" tppabs="http://www.python.org/doc/current/lib/modindex.html" title="Module Index"><img src="modules.gif" tppabs="http://www.python.org/doc/current/icons/modules.gif" border="0" height="32"
  alt="Module Index" width="32"></a></td>
<td><A href="genindex.html" tppabs="http://www.python.org/doc/current/lib/genindex.html"><img src="index.gif" tppabs="http://www.python.org/doc/current/icons/index.gif" border="0" height="32"
  alt="Index" width="32"></A></td>
</tr></table>
<b class="navlabel">Previous:</b> <a class="sectref" href="module-curses.wrapper.html" tppabs="http://www.python.org/doc/current/lib/module-curses.wrapper.html">6.14 curses.wrapper  </A>
<b class="navlabel">Up:</b> <a class="sectref" href="allos.html" tppabs="http://www.python.org/doc/current/lib/allos.html">6. Generic Operating System</A>
<b class="navlabel">Next:</b> <a class="sectref" href="module-getopt.html" tppabs="http://www.python.org/doc/current/lib/module-getopt.html">6.16 getopt  </A>
</DIV>
<!--End of Navigation Panel-->
<ADDRESS>
<hr>See <i><a href="about.html" tppabs="http://www.python.org/doc/current/lib/about.html">About this document...</a></i> for information on suggesting changes.
</ADDRESS>
</BODY>
</HTML>

⌨️ 快捷键说明

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