python 常用转义字符对照表 键盘各键对应的ASCII码值

这篇具有很好参考价值的文章主要介绍了python 常用转义字符对照表 键盘各键对应的ASCII码值。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

python中常见的转义字符有以下几种

1.\:续行符;

2.\:反斜杠符号;

3.\’:单引号;

4.\”:双引号;

5.\a:响铃;

6.\b:退格;

7.\e:转义;

8.\000:空;

9.\n:换行;

10.\v:纵向制表符;

11.\t:横向制表符;

12.\r:回车;

13.\f:换页;

14.\oyy:八进制数yy代表的字符;

15.\xyy:十进制数yy代表的字符;

键盘各键对应的ASCII码值 (0x指16进制,delete键的ascii码值是0x2e,也即十进制的46)
0x1 鼠标左键
0x2 鼠标右键
0x3 CANCEL 键
0x4 鼠标中键
0x8 BACKSPACE 键
0x9 TAB 键
0xC CLEAR 键
0xD ENTER 键
0x10 SHIFT 键
0x11 CTRL 键
0x12 MENU 键
0x13 PAUSE 键
0x14 CAPS LOCK 键
0x1B ESC 键
0x20 SPACEBAR 键
0x21 PAGE UP 键
0x22 PAGE DOWN 键
0x23 END 键
0x24 HOME 键
0x25 LEFT ARROW 键
0x26 UP ARROW 键
0x27 RIGHT ARROW 键
0x28 DOWN ARROW 键
0x29 SELECT 键
0x2A PRINT SCREEN 键
0x2B EXECUTE 键
0x2C SNAPSHOT 键
0x2D INSERT 键
0x2E DELETE 键
0x2F HELP 键
0x90 NUM LOCK 键
A 至 Z 键与 A – Z 字母的 ASCII 码相同:
值 描述
65 A 键
66 B 键
67 C 键
68 D 键
69 E 键
70 F 键
71 G 键
72 H 键
73 I 键
74 J 键
75 K 键
76 L 键
77 M 键
78 N 键
79 O 键
80 P 键
81 Q 键
82 R 键
83 S 键
84 T 键
85 U 键
86 V 键
87 W 键
88 X 键
89 Y 键
90 Z 键
0 至 9 键与数字 0 – 9 的 ASCII 码相同:
值 描述
48 0 键
49 1 键
50 2 键
51 3 键
52 4 键
53 5 键
54 6 键
55 7 键
56 8 键
57 9 键
下列常数代表数字键盘上的键:
值 描述
0x60 0 键
0x61 1 键
0x62 2 键
0x63 3 键
0x64 4 键
0x65 5 键
0x66 6 键
0x67 7 键
0x68 8 键
0x69 9 键
0x6A MULTIPLICATION SIGN (*) 键
0x6B PLUS SIGN (+) 键
0x6C ENTER 键
0x6D MINUS SIGN (–) 键
0x6E DECIMAL POINT (.) 键
0x6F DIVISION SIGN (/) 键
下列常数代表功能键:
值 描述
0x70 F1 键
0x71 F2 键
0x72 F3 键
0x73 F4 键
0x74 F5 键
0x75 F6 键
0x76 F7 键
0x77 F8 键
0x78 F9 键
0x79 F10 键
0x7A F11 键
0x7B F12 键
0x7C F13 键
0x7D F14 键
0x7E F15 键0x7F F16 键

参考
https://zhidao.baidu.com/question/497935915.html

https://www.yisu.com/ask/4508.html

输入 python telnet 输入 delete \x7F
Home: WWW Information: Publishing Web Docs:ASCII Characters
ASCII Characters
Operating systems, programming/scripting lanuages, protocols and text processing systems use characters in different ways. This summarizes the character set and some of the special uses of and restrictions on characters.
The ASCII (7-bit) (American National Standard Code for Information Interchange) code set is defined in ANSI Spec X3.4. Extended (8-bit codes), as defined in ISO8859-1, (Latin 1) can also be used in HTML.

Control Characters
Printable Characters
Usage of Special Characters
Special Characters allowed in names and addresses
ISO Latin and extended ASCII Character References
Text data: ASCII

See also: Special Character Names
Character Usage
There are two main codes in use for
character data: ASCII and EBCDIC. EBCDIC is used almost exclusively on IBM
machines and their clones. On most other computer systems,
, ASCII is used, so that is all we will discuss here.
ASCII is by far the more common of the two.

ASCII stands for American Standard Code for Information Interchange. It
contains a binary code for all the characters generated by the keyboard, and
a few others that are not generated by all keyboards.

The standard ASCII set consists of 128 binary codes, from 000 0000 to 111
1111. The msb of the byte is not written because it is sometimes reserved
for a parity bit (an error check: see later) and on some micro computers
another 128 special symbols (graphic characters or mathematical symbols) are
defined using this eighth bit. Since its use varies from one system to
another, we will explicitly write only the first 7 bits.

HTML Character References use the Decimal code. e.g. @ = ‘@’ .
URL Encoding uses Hex characters (e.g. %40 = @)

Control Characters
CTRL (^D means to hold the CTRL key and hit d)
Oct Dec Char Hex Key Comments
\000 0 NUL \x00 ^@ \0 (Null byte)
\001 1 SOH \x01 ^A (Start of heading)
\002 2 STX \x02 ^B (Start of text)
\003 3 ETX \x03 ^C (End of text) (see: UNIX keyboard CTRL)
\004 4 EOT \x04 ^D (End of transmission) (see: UNIX keyboard CTRL)
\005 5 ENQ \x05 ^E (Enquiry)
\006 6 ACK \x06 ^F (Acknowledge)
\007 7 BEL \x07 ^G (Ring terminal bell)
\010 8 BS \x08 ^H \b (Backspace) (\b matches backspace inside [] only)
(see: UNIX keyboard CTRL)
\011 9 HT \x09 ^I \t (Horizontal tab)
\012 10 LF \x0A ^J \n (Line feed) (Default UNIX NL) (see End of Line below)
\013 11 VT \x0B ^K (Vertical tab)
\014 12 FF \x0C ^L \f (Form feed)
\015 13 CR \x0D ^M \r (Carriage return) (see: End of Line below)
\016 14 SO \x0E ^N (Shift out)
\017 15 SI \x0F ^O (Shift in)
\020 16 DLE \x10 ^P (Data link escape)
\021 17 DC1 \x11 ^Q (Device control 1) (XON) (Default UNIX START char.)
\022 18 DC2 \x12 ^R (Device control 2)
\023 19 DC3 \x13 ^S (Device control 3) (XOFF) (Default UNIX STOP char.)
\024 20 DC4 \x14 ^T (Device control 4)
\025 21 NAK \x15 ^U (Negative acknowledge) (see: UNIX keyboard CTRL)
\026 22 SYN \x16 ^V (Synchronous idle)
\027 23 ETB \x17 ^W (End of transmission block)
\030 24 CAN \x18 ^X (Cancel)
\031 25 EM \x19 ^Y (End of medium)
\032 26 SUB \x1A ^Z (Substitute character)
\033 27 ESC \x1B 1 (Group separator, Information separator three)
\036 30 RS \x1E ^^ (Record separator, Information separator two)
\037 31 US \x1F ^_ (Unit separator, Information separator one)
\177 127 DEL \x7F ^? (Delete) (see: UNIX keyboard CTRL)
Printable Characters
Specials (32-47)
(See: Special Character Names)
\040 32 " " \x20 (space)
\041 33 ! \x21 EXCLAMATION POINT(bang)
\042 34 " \x22 QUOTATION MARK, DIAERESIS
\043 35 # \x23: NUMBER SIGN (Pound sign) (see: UNIX keyboard CTRL)
\044 36 $ \x24 DOLLAR SIGN
\045 37 % \x25 PERCENT SIGN
\046 38 & \x26 AMPERSAND
\047 39 ’ \x27 APOSTROPHE, RIGHT SINGLE QUOTATION MARK, ACUTE ACCENT (single quote)
\050 40 ( \x28 LEFT PARENTHESIS (open parenthesis)
\051 41 ) \x29 RIGHT PARENTHESIS (close parenthesis)
\052 42 * \x2A ASTERISK
\053 43 + \x2B PLUS SIGN
\054 44 , \x2C COMMA, CEDILLA
\055 45 - \x2D HYPHEN, MINUS SIGN
\056 46 . \x2E PERIOD, DECIMAL POINT, (Full Stop)
\057 47 / \x2F SLANT (SOLIDUS), slash
Digits
\060 48 0 \x30
\061 49 1 \x31
\062 50 2 \x32
\063 51 3 \x33
\064 52 4 \x34
\065 53 5 \x35
\066 54 6 \x36
\067 55 7 \x37
\070 56 8 \x38
\071 57 9 \x39

Specials (58-64)
\072 58 : \x3A COLON
\073 59 ; \x3B SEMICOLON
\074 60 < \x3C LESS-THAN SIGN (left angle bracket)
\075 61 = \x3D EQUALS SIGN
\076 62 > \x3E GREATER-THAN SIGN (right angle bracket)
\077 63 ? \x3F QUESTION MARK
\100 64 @ \x40 COMMERCIAL AT † (see: UNIX keyboard CTRL)
Latin Capital Letters
\101 65 A \x41 \112 74 J \x4A \123 83 S \x53
\102 66 B \x42 \113 75 K \x4B \124 84 T \x54
\103 67 C \x43 \114 76 L \x4C \125 85 U \x55
\104 68 D \x44 \115 77 M \x4D \126 86 V \x56
\105 69 E \x45 \116 78 N \x4E \127 87 W \x57
\106 70 F \x46 \117 79 O \x4F \130 88 X \x58
\107 71 G \x47 \120 80 P \x50 \131 89 Y \x59
\110 72 H \x48 \121 81 Q \x51 \132 90 Z \x5A
\111 73 I \x49 \122 82 R \x52

Specials (91-96)
\133 91 [ \x5B LEFT (SQUARE) BRACKET (open bracket) †
\134 92 \ \x5C REVERSE SLANT (REVERSE SOLIDUS) (backslash, backslant) †
\135 93 ] \x5D RIGHT (SQUARE) BRACKET (closing bracket) †
\136 94 ^ \x5E CIRCUMFLEX ACCENT †
\137 95 _ \x5F UNDERLINE (LOW LINE)
\140 96 ` \x60 LEFT SINGLE QUOTATION MARK, GRAVE ACCENT †

Latin Small Letters
\141 97 a \x61 \152 106 j \x6A \163 115 s \x73
\142 98 b \x62 \153 107 k \x6B \164 116 t \x74
\143 99 c \x63 \154 108 l \x6C \165 117 u \x75
\144 100 d \x64 \155 109 m \x6D \166 118 v \x76
\145 101 e \x65 \156 110 n \x6E \167 119 w \x77
\146 102 f \x66 \157 111 o \x6F \170 120 x \x78
\147 103 g \x67 \160 112 p \x70 \171 121 y \x79
\150 104 h \x68 \161 113 q \x71 \172 122 z \x7A
\151 105 i \x69 \162 114 r \x72

Specials (123-126)
\173 123 { \x7B LEFT BRACE (LEFT CURLY BRACKET) (open brace) †
\174 124 | \x7C VERTICAL LINE (pipe) †
\175 125 } \x7D RIGHT BRACE (RIGHT CURLY BRACKET) (closing brace) †
\176 126 ~ \x7E TILDE (OVERLINE) (squiggle) †

Control (127)
\177 127 DEL \x7F ^? (Delete) (see: UNIX keyboard CTRL)

† The characters following the letters may be used for additional
letters in countries with alphabets containing more than 26 letters.These characters should not bae used in international interchange
without determining that there is agreement between sender and recipient.

Usage of Special Characters
End of Line character

End of Line varies depending on the operating system:
DOS/Windows:
Macintosh:…
UNIX… (See File Format Notes for more information.)

UNIX Keyboard Control Characters
:
The default keyboard control characters vary depending on the UNIX system.
Most people change them with the stty command in their .profile.
SysV Sun/Solaris HP/UX
Erase (character delete) # (^H)
Kill (line delete) @ ^U @
Intr (Interupt process) ^C
EOF (End of File) ^D ^D ^D
EOF Signals End of File for characters input from
the terminal. Also causes shell to terminate.

Special Characters allowed in names and addresses:
Note: The only characters other than letters and digits which appear to
be universly acceptable are - (dash) and _ (underscore) and you
have to watch out for ‘-’ which can be interpreted as minus when
used in a name in certain perl scripts.

     (1)      (2) (3)

Octal UNIX DOS SMTP URL (HTML - allows all but <, >, &,and ")
\011 TAB
\040 " " - Spaces can be used in mail addresses if the addr. is quoted.
\041 ! * * * ! can cause problems in csh in UNIX.
\042 "
\043 # * * * (see: UNIX keyboard CTRL)
\044 $ * * *
\045 % * * *
\046 & * *
\047 ’ * * *
\050 ( *
\051 ) *
\052 * * *
\053 + * * * (URL’s sometimes use + for space)
\054 , *
\055 - * * * *
\056 . *
\057 / *
\072 : *
\073 ;
\074 <
\075 = * *
\076 >
\077 ? *
\100 @ * * (see: UNIX keyboard CTRL)
\133 [
\134
\135 ]
\136 ^ * *
\137 _ * * * *
\140 ` * *
\173 { * *
\174 | *
\175 } * *
\176 ~ * * *

(1) UNIX - Any character except “/” (slash) is allowed
in a UNIX file name but many are not recommended
because they cause problems in scripting and/or
programming languaages dealing with the files.
(2) SMTP - (Simple Mail Transfer Protocol)
(3)URI/URL - Uniform Resource Identifier/Locator. Other characters can
be used but require encoding with % and the HEX value (e.g. @ = %40)
(Space is sometimes encoded as “+”.)
(4) HTML - HyperText Markup Language requires 4 ASCII characters to be
encoded as character or entity references (escape sequences).
ASCII characters with special meaning in HTML so they must be encoded:
Character Entity
Character Reference Reference
< < <
> > >
& & &
" " "
Other common non-ASCII character encodings for HTML:
Description Code Entity name Octal Code
e, acute accent é --> é é --> é \351 (octal) = é
ampersand & --> & & --> &
registered trademark ® --> ® ® --> ®
copyright © --> © © --> ©
trademark � --> ™ TM --> TM

Other HTML Character Reference Tables
ISO8859-1, (Latin 1) notes and Character List at Best Business Solutions (BBS).
Extended ASCII (same as ISO859-1) at emory.edu

ISO (International Organization for Standardization) defines several character sets.
e.g. the ISO 8859 series.
HTML Character Entity names are defined targnet.org and uni-passau.

IBM
IBM uses (EBCDIC) Extended Binary Coded Decimal Interchange Code
(8-bit) coding on most of their systems.
They uses code pages to specify charact sets for keyboards, displays,
printers, … for DOS, AIX, Mainframes, …
Standard DOS code pages are:
437 United States
850 Multilingual (Latin 1)
852 Slavic (Latin 2)
863 Canadian-French
865 Nordic (Norwegian, Danish)
860 Portuguese
See:
IBM OS/390 Code Pages

General Info. on Code Pages

See also: BYTE article ‘Organizing Babylon’ on international character sets.

Netscape Character Sets
MIME Charset parameter in HTTP. If the server includes this parameter in its
response, Netscape Navigator will change its character set appropriately.
For example:

          Content-Type: text/html;charset=iso-8859-1
          Content-Type: text/html;charset=iso-2022-jp

   The charset names recognized by Netscape Navigator 1.1 are specified in

RFC 1700 (except for the names that begin with “x-”.) These include:
us-ascii
iso-8859-1
iso-2022-jp
x-sjis
x-euc-jp
x-mac-roman

   Additionally, the following aliases are recognized for us-ascii:

          ansi_x3.4-1968
          iso-ir-6
          ansi_x3.4-1986
          iso_646.irv:1991
          ascii
          iso646-us
          us
          ibm367
          cp367

Return to Publishing

Send comments and suggestions to mcbride@cc.bellcore.com

参考
https://stackoverflow.com/questions/26183298/how-do-i-send-telnetlib-control-c-command-in-python


  1. (Escape)
    \034 28 FS \x1C ^\ (File separator, Information separator four)
    \035 29 GS \x1D ^ ↩︎文章来源地址https://www.toymoban.com/news/detail-514969.html

到了这里,关于python 常用转义字符对照表 键盘各键对应的ASCII码值的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 前端 字体设置,中英文对照表 常用字体种类

    华文细黑:STHeiti Light [STXihei] 华文黑体:STHeiti 华文楷体:STKaiti 华文宋体:STSong 华文仿宋:STFangsong 儷黑 Pro:LiHei Pro Medium 儷宋 Pro:LiSong Pro Light 標楷體:BiauKai 蘋果儷中黑:Apple LiGothic Medium 蘋果儷細宋:Apple LiSung Light 新細明體:PMingLiU 細明體:MingLiU 標楷體:DFKai-SB 黑体:

    2024年02月07日
    浏览(92)
  • Stable Diffusion常用提示词中英文对照表

    Stable Diffusion常用提示词中英文对照表 1、提高质量的正向提示词 HDR,UHD,8K(HDR、UHD、4K、8K和64K)——这样的质量词可以带来巨大的差异提升照片的质量 best quality——最佳质量 masterpiece——杰作 Highly detailed——画出更多详细的细节 Studio lighting——添加演播室的灯光,可以为图像

    2024年02月12日
    浏览(53)
  • dBm和mW互相转换公式(以及常用功率对照表)

    一、dBm和mW互相转换公式 1. mW转dBm公式 2. dBm转mW公式 二、常用功率对照表 

    2024年02月13日
    浏览(45)
  • Python-Ai绘画-Disco Diffusion参数对照表

    Disco Diffusion完整基础参数对照表 变量名称 描述 默认值 text_prompts 对你希望机器生成的内容进行描述。 N/A image_prompts 可以设置一些参考图片,以对其内容的更多描述(可选) N/A clip_guidance_scale 控制图像与描述语的相似程度。 1000 tv_scale 控制最终输出的平滑度 150 range_scale 控制

    2024年01月17日
    浏览(34)
  • 中文数字对照表--课后程序(Python程序开发案例教程-黑马程序员编著-第4章-课后作业)

    阿拉伯数字因其具有简单易写、方便使用的特点成为了最流行的数字书写方式,但在使用阿拉伯数字计数时,可以对某些数字不漏痕迹的修改成其它数字,例如,将数字“1”修改为数字“7”,将数字“3”修改为数字“8”。为了避免引起不必要的麻烦,可以使用中文大写数字

    2024年02月05日
    浏览(77)
  • RGB颜色对照表

    常用颜色: 白色:rgb(255,255,255) 黑色:rgb(0,0,0) 红色:rgb(255,0,0) 绿色:rgb(0,255,0) 蓝色:rgb(0,0,255) 青色:rgb(0,255,255) 紫色:rgb(255,0,255) 颜色大全 RGB颜色对照表 对照表  

    2024年02月13日
    浏览(36)
  • GDB 到 LLDB 命令对照表

    Below is a table of GDB commands with their LLDB counterparts. The built in GDB-compatibility aliases in LLDB are also listed. The full lldb command names are often long, but any unique short form can be used. Instead of “ breakpoint set ”, “ br se ” is also acceptable. Execution Commands Breakpoint Commands Watchpoint Commands Examining Variables Ev

    2024年02月12日
    浏览(42)
  • Android 透明度颜色值对照表

      注:00是完全透明,FF就是完全不透明         我们的UI小姐姐就喜欢给 「不透明度」 ,这个需要自己判断一下。 二、透明度介绍         Android中的颜色值通常遵循RGB/ARGB标准,使用时通常以“#”字符开头,以16进制表示。         Android中的颜色值一般格式是:#AAR

    2024年04月14日
    浏览(77)
  • 各类主流设备屏幕尺寸查询,屏幕尺寸对照表

    Acer Chromebook Chrome 11.6 29.0 1366 768 1366 135 100% MDPI 16 : 9 0 Google Chromebook Pixel Chrome 12.9 33.0 2560 1700 1280 239 200% XHDPI 3 : 2 0 Samsung Chromebook Chrome 11.6 29.0 1366 768 1366 135 100% MDPI 16 : 9 0 Apple Cinema Display 30\\\" OS X 30.0 76.0 2560 1600 2560 100 100% MDPI 8 : 5 0 Apple Thunderbolt Display 27\\\" OS X 27.0 69.0 2560 1440 2560 1

    2024年02月05日
    浏览(150)
  • Http Content-type 对照表

    文件扩展名 Content-Type(Mime-Type) 文件扩展名 Content-Type(Mime-Type) .*( 二进制流,不知道下载文件类型) application/octet-stream .tif image/tiff .001 application/x-001 .301 application/x-301 .323 text/h323 .906 application/x-906 .907 drawing/907 .a11 application/x-a11 .acp audio/x-mei-aac .ai application/postscript .aif audio/aiff

    2024年02月09日
    浏览(45)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包