晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /proc/thread-self/root/usr/share/doc/python3-docs/html/_sources/library/ |
Upload File : |
:mod:`curses.ascii` --- Utilities for ASCII characters ====================================================== .. module:: curses.ascii :synopsis: Constants and set-membership functions for ASCII characters. .. moduleauthor:: Eric S. Raymond <esr@thyrsus.com> .. sectionauthor:: Eric S. Raymond <esr@thyrsus.com> -------------- The :mod:`curses.ascii` module supplies name constants for ASCII characters and functions to test membership in various ASCII character classes. The constants supplied are names for control characters as follows: +--------------+----------------------------------------------+ | Name | Meaning | +==============+==============================================+ | :const:`NUL` | | +--------------+----------------------------------------------+ | :const:`SOH` | Start of heading, console interrupt | +--------------+----------------------------------------------+ | :const:`STX` | Start of text | +--------------+----------------------------------------------+ | :const:`ETX` | End of text | +--------------+----------------------------------------------+ | :const:`EOT` | End of transmission | +--------------+----------------------------------------------+ | :const:`ENQ` | Enquiry, goes with :const:`ACK` flow control | +--------------+----------------------------------------------+ | :const:`ACK` | Acknowledgement | +--------------+----------------------------------------------+ | :const:`BEL` | Bell | +--------------+----------------------------------------------+ | :const:`BS` | Backspace | +--------------+----------------------------------------------+ | :const:`TAB` | Tab | +--------------+----------------------------------------------+ | :const:`HT` | Alias for :const:`TAB`: "Horizontal tab" | +--------------+----------------------------------------------+ | :const:`LF` | Line feed | +--------------+----------------------------------------------+ | :const:`NL` | Alias for :const:`LF`: "New line" | +--------------+----------------------------------------------+ | :const:`VT` | Vertical tab | +--------------+----------------------------------------------+ | :const:`FF` | Form feed | +--------------+----------------------------------------------+ | :const:`CR` | Carriage return | +--------------+----------------------------------------------+ | :const:`SO` | Shift-out, begin alternate character set | +--------------+----------------------------------------------+ | :const:`SI` | Shift-in, resume default character set | +--------------+----------------------------------------------+ | :const:`DLE` | Data-link escape | +--------------+----------------------------------------------+ | :const:`DC1` | XON, for flow control | +--------------+----------------------------------------------+ | :const:`DC2` | Device control 2, block-mode flow control | +--------------+----------------------------------------------+ | :const:`DC3` | XOFF, for flow control | +--------------+----------------------------------------------+ | :const:`DC4` | Device control 4 | +--------------+----------------------------------------------+ | :const:`NAK` | Negative acknowledgement | +--------------+----------------------------------------------+ | :const:`SYN` | Synchronous idle | +--------------+----------------------------------------------+ | :const:`ETB` | End transmission block | +--------------+----------------------------------------------+ | :const:`CAN` | Cancel | +--------------+----------------------------------------------+ | :const:`EM` | End of medium | +--------------+----------------------------------------------+ | :const:`SUB` | Substitute | +--------------+----------------------------------------------+ | :const:`ESC` | Escape | +--------------+----------------------------------------------+ | :const:`FS` | File separator | +--------------+----------------------------------------------+ | :const:`GS` | Group separator | +--------------+----------------------------------------------+ | :const:`RS` | Record separator, block-mode terminator | +--------------+----------------------------------------------+ | :const:`US` | Unit separator | +--------------+----------------------------------------------+ | :const:`SP` | Space | +--------------+----------------------------------------------+ | :const:`DEL` | Delete | +--------------+----------------------------------------------+ Note that many of these have little practical significance in modern usage. The mnemonics derive from teleprinter conventions that predate digital computers. The module supplies the following functions, patterned on those in the standard C library: .. function:: isalnum(c) Checks for an ASCII alphanumeric character; it is equivalent to ``isalpha(c) or isdigit(c)``. .. function:: isalpha(c) Checks for an ASCII alphabetic character; it is equivalent to ``isupper(c) or islower(c)``. .. function:: isascii(c) Checks for a character value that fits in the 7-bit ASCII set. .. function:: isblank(c) Checks for an ASCII whitespace character; space or horizontal tab. .. function:: iscntrl(c) Checks for an ASCII control character (in the range 0x00 to 0x1f or 0x7f). .. function:: isdigit(c) Checks for an ASCII decimal digit, ``'0'`` through ``'9'``. This is equivalent to ``c in string.digits``. .. function:: isgraph(c) Checks for ASCII any printable character except space. .. function:: islower(c) Checks for an ASCII lower-case character. .. function:: isprint(c) Checks for any ASCII printable character including space. .. function:: ispunct(c) Checks for any printable ASCII character which is not a space or an alphanumeric character. .. function:: isspace(c) Checks for ASCII white-space characters; space, line feed, carriage return, form feed, horizontal tab, vertical tab. .. function:: isupper(c) Checks for an ASCII uppercase letter. .. function:: isxdigit(c) Checks for an ASCII hexadecimal digit. This is equivalent to ``c in string.hexdigits``. .. function:: isctrl(c) Checks for an ASCII control character (ordinal values 0 to 31). .. function:: ismeta(c) Checks for a non-ASCII character (ordinal values 0x80 and above). These functions accept either integers or single-character strings; when the argument is a string, it is first converted using the built-in function :func:`ord`. Note that all these functions check ordinal bit values derived from the character of the string you pass in; they do not actually know anything about the host machine's character encoding. The following two functions take either a single-character string or integer byte value; they return a value of the same type. .. function:: ascii(c) Return the ASCII value corresponding to the low 7 bits of *c*. .. function:: ctrl(c) Return the control character corresponding to the given character (the character bit value is bitwise-anded with 0x1f). .. function:: alt(c) Return the 8-bit character corresponding to the given ASCII character (the character bit value is bitwise-ored with 0x80). The following function takes either a single-character string or integer value; it returns a string. .. function:: unctrl(c) Return a string representation of the ASCII character *c*. If *c* is printable, this string is the character itself. If the character is a control character (0x00--0x1f) the string consists of a caret (``'^'``) followed by the corresponding uppercase letter. If the character is an ASCII delete (0x7f) the string is ``'^?'``. If the character has its meta bit (0x80) set, the meta bit is stripped, the preceding rules applied, and ``'!'`` prepended to the result. .. data:: controlnames 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 ``SP`` for the space character.