A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://inventwithpython.com/bigbookpython/appendixb.html below:

Appendix B

B
Character Map

The print() function allows you to easily make any character you can type on the keyboard appear on the screen. However, there are many other characters you may like to display: the hearts, diamonds, clubs, and spades card suits; lines; shaded boxes; arrows; music notes; and so on. You can obtain string values of these characters by passing their numeric code, called a Unicode code point, to the chr() function. Text is stored on computers as a series of numbers, with each character represented by a different number. This appendix contains a list of such code points.

Using the chr() and ord() Functions

Python’s built-in chr() function accepts an integer argument and returns a string of the number’s character. The ord() function does the opposite: it accepts a string argument of a single character and returns the character’s number. This number is the code point for the character in the Unicode standard.

For example, enter the following into the interactive shell:

>>> chr(65)
'A'
>>> ord('A')
65
>>> chr(66)
'B'
>>> chr(9829)
'♥'

Not all numbers are valid code points for printable characters. The terminal windows that show the text output of programs may be limited in which characters they can display. The font the terminal window uses also must support the character your program prints. The terminal window prints a Unicode replacement character, , for any character it is unable to print.

Windows’ terminal window has a far more limited range of characters it can display. This set is known as the Windows Glyph List 4, and it appears in this appendix and on Wikipedia at https://en.wikipedia.org/wiki/Windows_Glyph_List_4.

The code points for characters are often listed with a base-16 hexadecimal number, as opposed to the base-10 decimal numbers we are used to. Instead of the decimal digits 0 to 9, hexadecimal has the digits 0 to 9 and then continues with the letters A to F. Hexadecimal numbers are often written with a 0x prefix to denote that the number that follows is in hex.

You can convert a decimal integer value to a string of the hexadecimal number with the hex() function. You can convert a string of the hexadecimal number to a decimal integer with the int() function, passing 16 as the second argument. For example, enter the following into the interactive shell:

>>> hex(9)
'0x9'
>>> hex(10)
'0xa'
>>> hex(15)
'0xf'
>>> hex(16)
'0x10'
>>> hex(17)
'0x11'
>>> int('0x11', 16)
17
>>> int('11', 16)
17

When calling the chr() function, you must pass a decimal integer as the argument, not a hexadecimal string.

Table of Code Points

The following are all the Unicode code points in the set known as Windows Glyph List 4, which are the characters supported by the Windows terminal program, Command Prompt. Both macOS and Linux can display more characters than are in this list, but to keep your Python programs compatible, I recommend you stick to the characters in this table.

  1. 32 <space>
  2. 33 !
  3. 34 "
  4. 35 #
  5. 36 $
  6. 37 %
  7. 38 &
  8. 39 '
  9. 40 (
  10. 41 )
  11. 42 *
  12. 43 +
  13. 44 ,
  14. 45 -
  15. 46 .
  16. 47 /
  17. 48 0
  18. 49 1
  19. 50 2
  20. 51 3
  21. 52 4
  22. 53 5
  23. 54 6
  24. 55 7
  25. 56 8
  26. 57 9
  27. 58 :
  28. 59 ;
  29. 60 <
  30. 61 =
  31. 62 >
  32. 63 ?
  33. 64 @
  34. 65 A
  35. 66 B
  36. 67 C
  37. 68 D
  38. 69 E
  39. 70 F
  40. 71 G
  41. 72 H
  42. 73 I
  43. 74 J
  44. 75 K
  45. 76 L
  46. 77 M
  47. 78 N
  48. 79 O
  49. 80 P
  50. 81 Q
  51. 82 R
  52. 83 S
  53. 84 T
  54. 85 U
  55. 86 V
  56. 87 W
  57. 88 X
  58. 89 Y
  59. 90 Z
  60. 91 [
  61. 92 \
  62. 93 ]
  63. 94 ^
  64. 95 _
  65. 96 `
  66. 97 a
  67. 98 b
  68. 99 c
  69. 100 d
  70. 101 e
  71. 102 f
  72. 103 g
  73. 104 h
  74. 105 i
  75. 106 j
  76. 107 k
  77. 108 l
  78. 109 m
  79. 110 n
  80. 111 o
  81. 112 p
  82. 113 q
  83. 114 r
  84. 115 s
  85. 116 t
  86. 117 u
  87. 118 v
  88. 119 w
  89. 120 x
  90. 121 y
  91. 122 z
  92. 123 {
  93. 124 |
  94. 125 }
  95. 126 ~
  96. 161 ¡
  97. 162 ¢
  98. 163 £
  99. 164 ¤
  100. 165 ¥
  101. 166 ¦
  102. 167 §
  103. 168 ¨
  104. 169 ©
  105. 170 ª
  106. 171 «
  107. 172 ¬
  108. 173 -
  109. 174 ®
  110. 175 ¯
  111. 176 °
  112. 177 ±
  113. 178 ²
  114. 179 ³
  115. 180 ´
  116. 181 µ
  117. 182 ¶
  118. 183 ·
  119. 184 ¸
  120. 185 ¹
  121. 186 º
  122. 187 »
  123. 188 ¼
  124. 189 ½
  125. 190 ¾
  126. 191 ¿
  127. 192 À
  128. 193 Á
  129. 194 Â
  130. 195 Ã
  131. 196 Ä
  132. 197 Å
  133. 198 Æ
  134. 199 Ç
  135. 200 È
  136. 201 É
  137. 202 Ê
  138. 203 Ë
  139. 204 Ì
  140. 205 Í
  141. 206 Î
  142. 207 Ï
  143. 209 Ñ
  144. 210 Ò
  145. 211 Ó
  146. 212 Ô
  147. 213 Õ
  148. 214 Ö
  149. 215 ×
  150. 216 Ø
  151. 217 Ù
  152. 218 Ú
  153. 219 Û
  154. 220 Ü
  155. 221 Ý
  156. 223 ß
  157. 224 à
  158. 225 á
  159. 226 â
  160. 227 ã
  161. 228 ä
  162. 229 å
  163. 230 æ
  164. 231 ç
  165. 232 è
  166. 233 é
  167. 234 ê
  168. 235 ë
  169. 236 ì
  170. 237 í
  171. 238 î
  172. 239 ï
  173. 241 ñ
  174. 242 ò
  175. 243 ó
  176. 244 ô
  177. 245 õ
  178. 246 ö
  179. 247 ÷
  180. 248 ø
  181. 249 ù
  182. 250 ú
  183. 251 û
  184. 252 ü
  185. 253 ý
  186. 255 ÿ
  187. 256 Ā
  188. 257 ā
  189. 258 Ă
  190. 259 ă
  191. 260 Ą
  192. 261 ą
  193. 262 Ć
  194. 263 ć
  195. 268 Č
  196. 269 č
  197. 270 Ď
  198. 271 ď
  199. 272 Đ
  200. 273 đ
  201. 274 Ē
  202. 275 ē
  203. 278 Ė
  204. 279 ė
  205. 280 Ę
  206. 281 ę
  207. 282 Ě
  208. 283 ě
  209. 286 Ğ
  210. 287 ğ
  211. 290 Ģ
  212. 291 ģ
  213. 298 Ī
  214. 299 ī
  215. 302 Į
  216. 303 į
  217. 304 İ
  218. 305 ı
  219. 310 Ķ
  220. 311 ķ
  221. 313 Ĺ
  222. 314 ĺ
  223. 315 Ļ
  224. 316 ļ
  225. 317 Ľ
  226. 318 ľ
  227. 321 Ł
  228. 322 ł
  229. 323 Ń
  230. 324 ń
  231. 325 Ņ
  232. 326 ņ
  233. 327 Ň
  234. 328 ň
  235. 332 Ō
  236. 333 ō
  237. 336 Ő
  238. 337 ő
  239. 338 Œ
  240. 339 œ
  241. 340 Ŕ
  242. 341 ŕ
  243. 342 Ŗ
  244. 343 ŗ
  245. 344 Ř
  246. 345 ř
  247. 346 Ś
  248. 347 ś
  249. 350 Ş
  250. 351 ş
  251. 352 Š
  252. 353 š
  253. 354 Ţ
  254. 355 ţ
  255. 356 Ť
  256. 357 ť
  257. 362 Ū
  258. 363 ū
  259. 366 Ů
  260. 367 ů
  261. 368 Ű
  262. 369 ű
  263. 370 Ų
  264. 371 ų
  265. 376 Ÿ
  266. 377 Ź
  267. 378 ź
  268. 379 Ż
  269. 380 ż
  270. 381 Ž
  271. 382 ž
  272. 402 ƒ
  273. 710 ˆ
  274. 711 ˇ
  275. 728 ˘
  276. 729 ˙
  277. 731 ˛
  278. 732 ˜
  279. 733 ˝
  280. 900 ΄
  281. 901 ΅
  282. 902 Ά
  283. 904 Έ
  284. 905 Ή
  285. 906 Ί
  286. 908 Ό
  287. 910 Ύ
  288. 911 Ώ
  289. 912 ΐ
  290. 913 Α
  291. 914 Β
  292. 915 Γ
  293. 916 Δ
  294. 917 Ε
  295. 918 Ζ
  296. 919 Η
  297. 920 Θ
  298. 921 Ι
  299. 922 Κ
  300. 923 Λ
  301. 924 Μ
  302. 925 Ν
  303. 926 Ξ
  304. 927 Ο
  305. 928 Π
  306. 929 Ρ
  307. 931 Σ
  308. 932 Τ
  309. 933 Υ
  310. 934 Φ
  311. 935 Χ
  312. 936 Ψ
  313. 937 Ω
  314. 938 Ϊ
  315. 939 Ϋ
  316. 940 ά
  317. 941 έ
  318. 942 ή
  319. 943 ί
  320. 944 ΰ
  321. 945 α
  322. 946 β
  323. 947 γ
  324. 948 δ
  325. 949 ε
  326. 950 ζ
  327. 951 η
  328. 952 θ
  329. 953 ι
  330. 954 κ
  331. 955 λ
  332. 956 μ
  333. 957 ν
  334. 958 ξ
  335. 959 ο
  336. 960 π
  337. 961 ρ
  338. 962 ς
  339. 963 σ
  340. 964 τ
  341. 965 υ
  342. 966 φ
  343. 967 χ
  344. 968 ψ
  345. 969 ω
  346. 970 ϊ
  347. 971 ϋ
  348. 972 ό
  349. 973 ύ
  350. 974 ώ
  351. 1025 Ё
  352. 1026 Ђ
  353. 1027 Ѓ
  354. 1028 Є
  355. 1029 Ѕ
  356. 1030 І
  357. 1031 Ї
  358. 1032 Ј
  359. 1033 Љ
  360. 1034 Њ
  361. 1035 Ћ
  362. 1036 Ќ
  363. 1038 Ў
  364. 1039 Џ
  365. 1040 А
  366. 1041 Б
  367. 1042 В
  368. 1043 Г
  369. 1044 Д
  370. 1045 Е
  371. 1046 Ж
  372. 1047 З
  373. 1048 И
  374. 1049 Й
  375. 1050 К
  376. 1051 Л
  377. 1052 М
  378. 1053 Н
  379. 1054 О
  380. 1055 П
  381. 1056 Р
  382. 1057 С
  383. 1058 Т
  384. 1059 У
  385. 1060 Ф
  386. 1061 Х
  387. 1062 Ц
  388. 1063 Ч
  389. 1064 Ш
  390. 1065 Щ
  391. 1066 Ъ
  392. 1067 Ы
  393. 1068 Ь
  394. 1069 Э
  395. 1070 Ю
  396. 1071 Я
  397. 1072 а
  398. 1073 б
  399. 1074 в
  400. 1075 г
  401. 1076 д
  402. 1077 е
  403. 1078 ж
  404. 1079 з
  405. 1080 и
  406. 1081 й
  407. 1082 к
  408. 1083 л
  409. 1084 м
  410. 1085 н
  411. 1086 о
  412. 1087 п
  413. 1088 р
  414. 1089 с
  415. 1090 т
  416. 1091 у
  417. 1092 ф
  418. 1093 х
  419. 1094 ц
  420. 1095 ч
  421. 1096 ш
  422. 1097 щ
  423. 1098 ъ
  424. 1099 ы
  425. 1100 ь
  426. 1101 э
  427. 1102 ю
  428. 1103 я
  429. 1105 ё
  430. 1106 ђ
  431. 1107 ѓ
  432. 1108 є
  433. 1109 ѕ
  434. 1110 і
  435. 1111 ї
  436. 1112 ј
  437. 1113 љ
  438. 1114 њ
  439. 1115 ћ
  440. 1116 ќ
  441. 1118 ў
  442. 1119 џ
  443. 1168 Ґ
  444. 1169 ґ
  445. 8211 –
  446. 8212 —
  447. 8213 ―
  448. 8216 ‘
  449. 8217 ’
  450. 8218 ‚
  451. 8220 “
  452. 8221 ”
  453. 8222 „
  454. 8224 †
  455. 8225 ‡
  456. 8226 •
  457. 8230 …
  458. 8240 ‰
  459. 8249 ‹
  460. 8250 ›
  461. 8319
  462. 8359 ₧
  463. 8364 €
  464. 8470 №
  465. 8482 ™
  466. 8729
  467. 8730 √
  468. 8734 ∞
  469. 8745
  470. 8776 ≈
  471. 8801
  472. 8804 ≤
  473. 8805 ≥
  474. 8976
  475. 8992
  476. 8993
  477. 9472 ─
  478. 9474 │
  479. 9484 ┌
  480. 9488 ┐
  481. 9492 └
  482. 9496 ┘
  483. 9500 ├
  484. 9508 ┤
  485. 9516 ┬
  486. 9524 ┴
  487. 9532 ┼
  488. 9552 ═
  489. 9553 ║
  490. 9554 ╒
  491. 9555 ╓
  492. 9556 ╔
  493. 9557 ╕
  494. 9558 ╖
  495. 9559 ╗
  496. 9560 ╘
  497. 9561 ╙
  498. 9562 ╚
  499. 9563 ╛
  500. 9564 ╜
  501. 9565 ╝
  502. 9566 ╞
  503. 9567 ╟
  504. 9568 ╠
  505. 9569 ╡
  506. 9570 ╢
  507. 9571 ╣
  508. 9572 ╤
  509. 9573 ╥
  510. 9574 ╦
  511. 9575 ╧
  512. 9576 ╨
  513. 9577 ╩
  514. 9578 ╪
  515. 9579 ╫
  516. 9580 ╬
  517. 9600 ▀
  518. 9604 ▄
  519. 9608 █
  520. 9612 ▌
  521. 9616 ▐
  522. 9617 ░
  523. 9618 ▒
  524. 9619 ▓
  525. 9632 ■
  526. 9633 □
  527. 9642 ▪
  528. 9643 ▫
  529. 9644 ▬
  530. 9650 ▲
  531. 9658 ►
  532. 9660 ▼
  533. 9668 ◄
  534. 9674 ◊
  535. 9675 ○
  536. 9679 ●
  537. 9688 ◘
  538. 9689 ◙
  539. 9702 ◦
  540. 9786 ☺
  541. 9787 ☻
  542. 9788 ☼
  543. 9792 ♀
  544. 9794 ♂
  545. 9824 ♠
  546. 9827 ♣
  547. 9829 ♥
  548. 9830 ♦
  549. 9834 ♪
  550. 9835 ♫

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4