ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)

ASCII相关文章汇总如下:

  • ASCII码对照表(255个ascii字符汇总)
  • ASCII码对照表(Unicode 字符集列表)
  • ASCII码对照表(emoji表情符号)
  • ASCII码对照表(Python代码实现打印)
  • ASCII码对照表(C++17 实现ANSI、UTF8、Unicode编码互转)

文章目录

  • 1、安装Python
  • 2、安装Visual Studio Code
  • 3、使用命令行方法打印
  • 4、使用python-docx库方法打印(WORD文档)
    • 4.1 安装python-docx库
    • 4.2 文件输出ASCII码对照表
  • 5、使用xlwt库方法打印(EXCEL文档)
    • 5.1 安装xlwt库
    • 5.2 文件输出ASCII码对照表
  • 6、使用fpdf库方法打印(PDF文档)
    • 6.1 安装fpdf库
    • 6.2 文件输出ASCII码对照表
  • 7、中文的ascii码
  • 8、英文的ascii码
  • 后记

这里用Python3.9.7打印出ASCII编码字符。
最后使用python-docx扩展库将ascii表格内容保存为docx格式的word文件,方便小伙伴们打印。

ASCII码对照表的详细知识请参看如下链接:
https://blog.csdn.net/hhy321/article/details/120610891

1、安装Python

具体步骤详情见如下链接:
【小沐学python】(一)Python简介和安装
https://blog.csdn.net/hhy321/article/details/120306537
ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第1张图片

2、安装Visual Studio Code

编写Python脚本需要一个编辑器,这里我们选择微软提供的免费工具VsCode。
VsCode的官网下载地址如下:
https://code.visualstudio.com/
VSCode的具体配置步骤详情也可以在如下链接找到:
【小沐学python】(一)Python简介和安装
https://blog.csdn.net/hhy321/article/details/120306537

3、使用命令行方法打印

打开操作系统自带的命令行程序cmd.exe,输入如下命令:

# -*- coding: utf-8 -*-
# @File    : test_cmdline.py
# @Time    : 2022/02/07 20:20
# @Author  : 爱看书的小沐
# @Blog    : https://blog.csdn.net/hhy321?type=blog
# @Desc    : 打印ASCII对照表到命令行。

import string

# 打印ASCII 字母
arr = string.ascii_letters
print('字母有{}个字符:\t{}'.format(len(arr), arr))

# 打印ASCII 数字
arr = string.digits
print('数字有{}个字符:\t{}'.format(len(arr), arr))

# 打印ASCII 标点符号
arr = string.punctuation
print('其他有{}个字符:\t{}'.format(len(arr), arr))

ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第2张图片
打开操作系统自带的命令行程序cmd.exe,输入如下命令:

# -*- coding: utf-8 -*-
# @File    : test_cmdline2.py
# @Time    : 2022/02/07 20:20
# @Author  : 爱看书的小沐
# @Blog    : https://blog.csdn.net/hhy321?type=blog
# @Desc    : 打印ASCII对照表到命令行。

# create ascii table
def create_table(data, COL=3):

    # 定义变量
    NUM = 128
    ROW = int(NUM/COL)
    if NUM % COL != 0:
        ROW = ROW + 1

    # 填充表格的标题
    title = ["Dec", "Binary", "Oct", "Hex", "Char"]
    line = []
    for i in range(0, COL*len(title)):
        line.append(title[i % 5])
    data.append(line)

    # 填充表格的正文内容
    for i in range(0, ROW):
        line = []
        for i in range(0, COL*len(title)):
            line.append("")
        data.append(line)

    # 列举打印不可见的的字符
    invisibleCharArr = ["NUL", "SOH",  "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", "BS", "HT", "LF", "VT", "FF", "CR", "SO",
                        "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US", "SPACE"]

    # 填充表格的内容
    for i in range(0, NUM):

        j = int(i / ROW)
        JJ = j * 5
        II = i + 1 - int(j * ROW)

        data[II][0 + JJ] = str(i)
        data[II][1 + JJ] = bin(i)[2:].rjust(8, '0')
        data[II][2 + JJ] = oct(i)[2:].rjust(3, '0')
        data[II][3 + JJ] = hex(i)[2:].rjust(2, '0').upper()

        # Char
        try:
            if i == 127:
                data[II][4 + JJ] = "DEL"
            elif i > 32:
                data[II][4 + JJ] = chr(i)
            else:
                data[II][4 + JJ] = invisibleCharArr[i]
        except ValueError as e:
            print(e)

# print ascii table
def print_table(data):
    for row in data:
        k = 0
        for item in row:
            if (k - 1) % 5 == 0:
                print(item.ljust(9), end=" ")
            else:
                print(item.ljust(5), end=" ")
            k = k + 1
        print("")


if __name__ == '__main__':
    data = []
    create_table(data, 3)
    print_table(data)

输出1列:
ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第3张图片
输出2列:
ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第4张图片
输出3列:
ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第5张图片
输出4列:
ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第6张图片
输出5列:
ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第7张图片

4、使用python-docx库方法打印(WORD文档)

4.1 安装python-docx库

打开操作系统自带的命令行程序cmd.exe,输入如下命令:

pip install python-docx

ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第8张图片

4.2 文件输出ASCII码对照表

  • 打开VsCode程序。
  • 新建一个python文件:test_toword.py
  • 输入如下脚本:
# -*- coding: utf-8 -*-
# @File    : test_toword.py
# @Time    : 2022/02/07 20:20
# @Author  : 爱看书的小沐
# @Blog    : https://blog.csdn.net/hhy321?type=blog
# @Desc    : 打印ASCII对照表到Word文件里。

from tkinter import E
from docx import Document
from docx.shared import Pt
from docx.enum.text import WD_PARAGRAPH_ALIGNMENT
from docx.shared import Cm
from docx.shared import RGBColor

doc = Document()
table = doc.add_table(rows=128+1, cols=5, style='Table Grid')

table.style.font.size = Pt(10)
table.style.font.color.rgb = RGBColor(0, 0, 0)
table.style.paragraph_format.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER

# 填充表格的标题
table.cell(0, 0).text = "Dec"
table.cell(0, 1).text = "Binary"
table.cell(0, 2).text = "Oct"
table.cell(0, 3).text = "Hex"
table.cell(0, 4).text = "Char"

## 列举打印不可见的的字符
invisibleCharArr = ["NUL", "SOH",  "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", "BS", "HT", "LF", "VT", "FF", "CR", "SO",
                    "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US", "SPACE"]

# 填充表格的内容
for i in range(0, 128):
    print(chr(i), end="")

    # Dec
    cell = table.cell(i+1, 0)
    cell.text = str(i)

    # Binary
    cell = table.cell(i+1, 1)
    cell.text = bin(i)[2:].rjust(8, '0')

    # Oct
    cell = table.cell(i+1, 2)
    cell.text = oct(i)[2:].rjust(3, '0')

    # Hex
    cell = table.cell(i+1, 3)
    cell.text = hex(i)[2:].rjust(2, '0').upper()

    # Char
    cell = table.cell(i+1, 4)
    try:
        if i > 32:
            cell.text = chr(i)
        else:
            cell.text = invisibleCharArr[i]
    except ValueError as e:
        print(e)

cell = table.cell(128, 4)
cell.text = "DEL"

## 保存为docx文件
doc.save('d:\\ascill_table.docx')

ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第9张图片
运行之后,自动生成一个文件d:\ascill_table.docx。
ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第10张图片
ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第11张图片

5、使用xlwt库方法打印(EXCEL文档)

5.1 安装xlwt库

打开操作系统自带的命令行程序cmd.exe,输入如下命令:

pip install xlwt

ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第12张图片

5.2 文件输出ASCII码对照表

  • 打开VsCode程序。
  • 新建一个python文件:test_toexcel.py
  • 输入如下脚本:
# -*- coding: utf-8 -*-
# @File    : test_toexcel.py
# @Time    : 2022/02/07 20:20
# @Author  : 爱看书的小沐
# @Blog    : https://blog.csdn.net/hhy321?type=blog
# @Desc    : 打印ASCII对照表到excel文件里。

import xlwt

# create ascii table
def create_table(data, COL=3):

    # 定义变量
    NUM = 128
    ROW = int(NUM/COL)
    if NUM % COL != 0:
        ROW = ROW + 1

    # 填充表格的标题
    title = ["Dec", "Binary", "Oct", "Hex", "Char"]
    line = []
    for i in range(0, COL*len(title)):
        line.append(title[i % 5])
    data.append(line)

    # 填充表格的正文内容
    for i in range(0, ROW):
        line = []
        for i in range(0, COL*len(title)):
            line.append("")
        data.append(line)

    # 列举打印不可见的的字符
    invisibleCharArr = ["NUL", "SOH",  "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", "BS", "HT", "LF", "VT", "FF", "CR", "SO",
                        "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US", "SPACE"]

    # 填充表格的内容
    for i in range(0, NUM):

        j = int(i / ROW)
        JJ = j * 5
        II = i + 1 - int(j * ROW)

        data[II][0 + JJ] = str(i)
        data[II][1 + JJ] = bin(i)[2:].rjust(8, '0')
        data[II][2 + JJ] = oct(i)[2:].rjust(3, '0')
        data[II][3 + JJ] = hex(i)[2:].rjust(2, '0').upper()

        # Char
        try:
            if i == 127:
                data[II][4 + JJ] = "DEL"
            elif i > 32:
                data[II][4 + JJ] = chr(i)
            else:
                data[II][4 + JJ] = invisibleCharArr[i]
        except ValueError as e:
            print(e)

# write ascii table to excel
def write_excelfile(filename, data):

    # 创建Excel工作薄
    myWorkbook = xlwt.Workbook()

    # 添加Excel工作表
    mySheet = myWorkbook.add_sheet('Ascii Table')

    # 设置单元格字体
    font = xlwt.Font()
    font.name = 'name Times New Roman'
    font.height = 20*9

    font1 = xlwt.Font()
    font1.name = 'name Times New Roman'
    font1.height = 20*9
    font1.bold = True
    font1.colour_index = 4

    # 设置单元格对齐方式
    alignment = xlwt.Alignment()
    alignment.horz = 0x02
    alignment.vert = 0x02

    pattern = xlwt.Pattern()
    pattern.pattern = xlwt.Pattern.SOLID_PATTERN 
    pattern.pattern_fore_colour = 22
    pattern.pattern_back_colour = 0

    # 新建样式
    myStyle0 = xlwt.XFStyle()
    myStyle0.font = font
    myStyle0.alignment = alignment

    myStyle1 = xlwt.XFStyle()
    myStyle1.font = font1
    myStyle1.alignment = alignment
    myStyle1.pattern = pattern

    # 新建样式2
    myStyleT = xlwt.easyxf(
        'font: name Times New Roman, color-index red, bold on;align: horiz center;align: vert center')
    myStyleT.pattern = pattern

    i = 0
    for row in data:
        j = 0
        for item in row:
            if j % 5 == 0 and i > 0:
                mySheet.write(i, j, item, myStyle1)
            elif i == 0 :
                mySheet.write(i, j, item, myStyleT)
            else:
                mySheet.write(i, j, item, myStyle0)
            j = j + 1
        i = i + 1

    myWorkbook.save(filename)

if __name__ == '__main__':
    data = []
    create_table(data, 4)
    write_excelfile('d:\\ascill_table.xls', data)

打印1列,输出如下:
ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第13张图片
打印2列,输出如下:
ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第14张图片
打印3列,输出如下:
ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第15张图片
打印4列,输出如下:
ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第16张图片

6、使用fpdf库方法打印(PDF文档)

6.1 安装fpdf库

打开操作系统自带的命令行程序cmd.exe,输入如下命令:

pip install fpdf

ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第17张图片

6.2 文件输出ASCII码对照表

  • 打开VsCode程序。
  • 新建一个python文件:test_topdf_L.py
  • 输入如下脚本:
# -*- coding: utf-8 -*-
# @File    : test_topdf_L.py
# @Time    : 2022/02/07 20:20
# @Author  : 爱看书的小沐
# @Blog    : https://blog.csdn.net/hhy321?type=blog
# @Desc    : 打印ASCII对照表到pdf文件里。

from fpdf import FPDF

# create ascii table
def create_table(data, COL=3):

    # 定义变量
    NUM = 128
    ROW = int(NUM/COL)
    if NUM % COL != 0:
        ROW = ROW + 1

    # 填充表格的标题
    title = ["Dec", "Binary", "Oct", "Hex", "Char"]
    line = []
    for i in range(0, COL*len(title)):
        line.append(title[i % 5])
    data.append(line)

    # 填充表格的正文内容
    for i in range(0, ROW):
        line = []
        for i in range(0, COL*len(title)):
            line.append("")
        data.append(line)

    # 列举打印不可见的的字符
    invisibleCharArr = ["NUL", "SOH",  "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", "BS", "HT", "LF", "VT", "FF", "CR", "SO",
                        "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US", "SPACE"]

    # 填充表格的内容
    for i in range(0, NUM):

        j = int(i / ROW)
        JJ = j * 5
        II = i + 1 - int(j * ROW)

        data[II][0 + JJ] = str(i)
        data[II][1 + JJ] = bin(i)[2:].rjust(8, '0')
        data[II][2 + JJ] = oct(i)[2:].rjust(3, '0')
        data[II][3 + JJ] = hex(i)[2:].rjust(2, '0').upper()

        # Char
        try:
            if i == 127:
                data[II][4 + JJ] = "DEL"
            elif i > 32:
                data[II][4 + JJ] = chr(i)
            else:
                data[II][4 + JJ] = invisibleCharArr[i]
        except ValueError as e:
            print(e)

# print ascii table
def print_table(data):
    for row in data:
        k = 0
        for item in row:
            if (k - 1) % 5 == 0:
                print(item.ljust(9), end=" ")
            else:
                print(item.ljust(5), end=" ")
            k = k + 1
        print("")

# write ascii table to pdf file
def write_pdffile(filename, ori='L', wscale=16, spacing=1.1):
     # pdf = FPDF()
    pdf = FPDF(orientation=ori, unit='mm', format='A4')
    pdf.set_font("Arial", size=9)
    pdf.add_page()
    
    col_width = pdf.w / wscale
    row_height = pdf.font_size + 0.5

    for row in data:
        for item in row:
            pdf.cell(col_width, row_height*spacing, txt=item, border=1, ln=0, align='C')
        pdf.ln(row_height*spacing)
        # print(row)

    pdf.output(filename)

if __name__ == '__main__':
    data = []
    create_table(data, 1)
    # print_table(data)
    write_pdffile('d://ascii_table_L.pdf', 'P', 7)
  • 竖排方向输出:
if __name__ == '__main__':
    data = []
    create_table(data, 1)
    # print_table(data)
    write_pdffile('d://ascii_table_L.pdf', 'P', 7)

ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第18张图片

  • 横排方向输出:
if __name__ == '__main__':
    data = []
    create_table(data, 3)
    # print_table(data)
    write_pdffile('d://ascii_table_L.pdf', 'L', 16)

ASCII码对照表(Python代码实现打印,python-docx库/xlwt库/fpdf库)_第19张图片

7、中文的ascii码

http://www.unicode.org/charts/PDF/U4E00.pdf
https://sf-zhou.github.io/programming/chinese_unicode_encoding_table.htm

ASCII 码仅规定了 128 个字符,只能满足英文的基本需求。一个字节最多能表示 256 个字符,而中文的常用汉字就有数千了,需要使用多个字节来表示汉字。两个字节可以表示的字符上限为 65536,绝大部分情况下能够满足汉字使用的需求了。经典的汉字编码包括 GBK、GB2312、GB18030、CP939 等。

Unicode 便是便是文字和符号的统一度量衡。Unicode,Unique Code,Universe Code,全世界每一个字符对应一个唯一的编码。Unicode 收录了大量的汉字,汉字的编码从 0x4E00 开始,到 0x9FFF 结束。

Unicode本身只规定了每个字符的数字编号是多少,并没有规定这个编号如何存储。然而 Unicode 仅仅定义了符号与二进制编码的关系,但没有定义如何存储和解析这些二进制编码。如果直接将二进制编码写入文件,那么读取时会产生歧义。例如 4E 00 41,你无法知道这记录的是 1 个字符,还是 2 个字符,或者是 3 个字符。如果统一每个字符的记录长度,那么对于常用中文便需要至少 3 个字节来表示一个符号,那么对于全英的文件则太浪费了。

Unicode 解决了编码统一的问题,但没有解决编码存储和解析的问题。UTF-8 则解决了 Unicode 没有解决的问题。UTF-8 是一种变长编码,会使用 1 到 4 个字节表示一个字符,类似于哈夫曼树

Unicode 范围(十六进制) UTF-8 编码方式(二进制)
0000 0000 ~ 0000 007F 0xxxxxxx
0000 0080 ~ 0000 07FF 110xxxxx 10xxxxxx
0000 0800 ~ 0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx
0001 0000 ~ 0010 FFFF 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx

8、英文的ascii码

Full list of ASCII characters, letters, symbols and signs with descriptions:
ASCII control characters non printable :ASCII code 00 = NULL ( Null character )
ASCII code 01 = SOH ( Start of Header )
ASCII code 02 = STX ( Start of Text )
ASCII code 03 = ETX ( End of Text, hearts card suit )
ASCII code 04 = EOT ( End of Transmission, diamonds card suit )
ASCII code 05 = ENQ ( Enquiry, clubs card suit )
ASCII code 06 = ACK ( Acknowledgement, spade card suit )
ASCII code 07 = BEL ( Bell )
ASCII code 08 = BS ( Backspace )
ASCII code 09 = HT ( Horizontal Tab )
ASCII code 10 = LF ( Line feed )
ASCII code 11 = VT ( Vertical Tab, male symbol, symbol for Mars )
ASCII code 12 = FF ( Form feed, female symbol, symbol for Venus )
ASCII code 13 = CR ( Carriage return )
ASCII code 14 = SO ( Shift Out )
ASCII code 15 = SI ( Shift In )
ASCII code 16 = DLE ( Data link escape )
ASCII code 17 = DC1 ( Device control 1 )
ASCII code 18 = DC2 ( Device control 2 )
ASCII code 19 = DC3 ( Device control 3 )
ASCII code 20 = DC4 ( Device control 4 )
ASCII code 21 = NAK ( NAK Negative-acknowledge )
ASCII code 22 = SYN ( Synchronous idle )
ASCII code 23 = ETB ( End of trans. block )
ASCII code 24 = CAN ( Cancel )
ASCII code 25 = EM ( End of medium )
ASCII code 26 = SUB ( Substitute )
ASCII code 27 = ESC ( Escape )
ASCII code 28 = FS ( File separator )
ASCII code 29 = GS ( Group separator )
ASCII code 30 = RS ( Record separator )
ASCII code 31 = US ( Unit separator )
ASCII code 127 = DEL ( Delete )
Printable ASCII characters :
( alphanumeric, symbols and signs )ASCII code 32 = space ( Space )
ASCII code 33 = ! ( Exclamation mark )
ASCII code 34 = " ( Double quotes ; Quotation mark ; speech marks )
ASCII code 35 = # ( Number sign )
ASCII code 36 = $ ( Dollar sign )
ASCII code 37 = % ( Percent sign )
ASCII code 38 = & ( Ampersand )
ASCII code 39 = ’ ( Single quote or Apostrophe )
ASCII code 40 = ( ( round brackets or parentheses, opening round bracket )
ASCII code 41 = ) ( parentheses or round brackets, closing parentheses )
ASCII code 42 = * ( Asterisk )
ASCII code 43 = + ( Plus sign )
ASCII code 44 = , ( Comma )
ASCII code 45 = - ( Hyphen , minus sign )
ASCII code 46 = . ( Dot, full stop )
ASCII code 47 = / ( Slash , forward slash , fraction bar , division slash )
ASCII code 48 = 0 ( number zero )
ASCII code 49 = 1 ( number one )
ASCII code 50 = 2 ( number two )
ASCII code 51 = 3 ( number three )
ASCII code 52 = 4 ( number four )
ASCII code 53 = 5 ( number five )
ASCII code 54 = 6 ( number six )
ASCII code 55 = 7 ( number seven )
ASCII code 56 = 8 ( number eight )
ASCII code 57 = 9 ( number nine )
ASCII code 58 = : ( Colon )
ASCII code 59 = ; ( Semicolon )
ASCII code 60 = < ( Less-than sign )
ASCII code 61 = = ( Equals sign )
ASCII code 62 = > ( Greater-than sign ; Inequality )
ASCII code 63 = ? ( Question mark )
ASCII code 64 = @ ( At sign )
ASCII code 65 = A ( Capital letter A )
ASCII code 66 = B ( Capital letter B )
ASCII code 67 = C ( Capital letter C )
ASCII code 68 = D ( Capital letter D )
ASCII code 69 = E ( Capital letter E )
ASCII code 70 = F ( Capital letter F )
ASCII code 71 = G ( Capital letter G )
ASCII code 72 = H ( Capital letter H )
ASCII code 73 = I ( Capital letter I )
ASCII code 74 = J ( Capital letter J )
ASCII code 75 = K ( Capital letter K )
ASCII code 76 = L ( Capital letter L )
ASCII code 77 = M ( Capital letter M )
ASCII code 78 = N ( Capital letter N )
ASCII code 79 = O ( Capital letter O )
ASCII code 80 = P ( Capital letter P )
ASCII code 81 = Q ( Capital letter Q )
ASCII code 82 = R ( Capital letter R )
ASCII code 83 = S ( Capital letter S )
ASCII code 84 = T ( Capital letter T )
ASCII code 85 = U ( Capital letter U )
ASCII code 86 = V ( Capital letter V )
ASCII code 87 = W ( Capital letter W )
ASCII code 88 = X ( Capital letter X )
ASCII code 89 = Y ( Capital letter Y )
ASCII code 90 = Z ( Capital letter Z )
ASCII code 91 = [ ( square brackets or box brackets, opening bracket )
ASCII code 92 = \ ( Backslash , reverse slash )
ASCII code 93 = ] ( box brackets or square brackets, closing bracket )
ASCII code 94 = ^ ( Circumflex accent or Caret )
ASCII code 95 = _ ( underscore , understrike , underbar or low line )
ASCII code 96 = ` ( Grave accent )
ASCII code 97 = a ( Lowercase letter a , minuscule a )
ASCII code 98 = b ( Lowercase letter b , minuscule b )
ASCII code 99 = c ( Lowercase letter c , minuscule c )
ASCII code 100 = d ( Lowercase letter d , minuscule d )
ASCII code 101 = e ( Lowercase letter e , minuscule e )
ASCII code 102 = f ( Lowercase letter f , minuscule f )
ASCII code 103 = g ( Lowercase letter g , minuscule g )
ASCII code 104 = h ( Lowercase letter h , minuscule h )
ASCII code 105 = i ( Lowercase letter i , minuscule i )
ASCII code 106 = j ( Lowercase letter j , minuscule j )
ASCII code 107 = k ( Lowercase letter k , minuscule k )
ASCII code 108 = l ( Lowercase letter l , minuscule l )
ASCII code 109 = m ( Lowercase letter m , minuscule m )
ASCII code 110 = n ( Lowercase letter n , minuscule n )
ASCII code 111 = o ( Lowercase letter o , minuscule o )
ASCII code 112 = p ( Lowercase letter p , minuscule p )
ASCII code 113 = q ( Lowercase letter q , minuscule q )
ASCII code 114 = r ( Lowercase letter r , minuscule r )
ASCII code 115 = s ( Lowercase letter s , minuscule s )
ASCII code 116 = t ( Lowercase letter t , minuscule t )
ASCII code 117 = u ( Lowercase letter u , minuscule u )
ASCII code 118 = v ( Lowercase letter v , minuscule v )
ASCII code 119 = w ( Lowercase letter w , minuscule w )
ASCII code 120 = x ( Lowercase letter x , minuscule x )
ASCII code 121 = y ( Lowercase letter y , minuscule y )
ASCII code 122 = z ( Lowercase letter z , minuscule z )
ASCII code 123 = { ( braces or curly brackets, opening braces )
ASCII code 124 = | ( vertical-bar, vbar, vertical line or vertical slash )
ASCII code 125 = } ( curly brackets or braces, closing curly brackets )
ASCII code 126 = ~ ( Tilde ; swung dash )
ASCII Extended Characters :ASCII code 128 = Ç ( Majuscule C-cedilla )
ASCII code 129 = ü ( letter u with umlaut or diaeresis , u-umlaut )
ASCII code 130 = é ( letter e with acute accent or e-acute )
ASCII code 131 = â ( letter a with circumflex accent or a-circumflex )
ASCII code 132 = ä ( letter a with umlaut or diaeresis , a-umlaut )
ASCII code 133 = à ( letter a with grave accent )
ASCII code 134 = å ( letter a with a ring )
ASCII code 135 = ç ( Minuscule c-cedilla )
ASCII code 136 = ê ( letter e with circumflex accent or e-circumflex )
ASCII code 137 = ë ( letter e with umlaut or diaeresis ; e-umlauts )
ASCII code 138 = è ( letter e with grave accent )
ASCII code 139 = ï ( letter i with umlaut or diaeresis ; i-umlaut )
ASCII code 140 = î ( letter i with circumflex accent or i-circumflex )
ASCII code 141 = ì ( letter i with grave accent )
ASCII code 142 = Ä ( letter A with umlaut or diaeresis ; A-umlaut )
ASCII code 143 = Å ( Capital letter A with a ring )
ASCII code 144 = É ( Capital letter E with acute accent or E-acute )
ASCII code 145 = æ ( Latin diphthong ae in lowercase )
ASCII code 146 = Æ ( Latin diphthong AE in uppercase )
ASCII code 147 = ô ( letter o with circumflex accent or o-circumflex )
ASCII code 148 = ö ( letter o with umlaut or diaeresis ; o-umlaut )
ASCII code 149 = ò ( letter o with grave accent )
ASCII code 150 = û ( letter u with circumflex accent or u-circumflex )
ASCII code 151 = ù ( letter u with grave accent )
ASCII code 152 = ÿ ( Lowercase letter y with diaeresis )
ASCII code 153 = Ö ( Letter O with umlaut or diaeresis ; O-umlaut )
ASCII code 154 = Ü ( Letter U with umlaut or diaeresis ; U-umlaut )
ASCII code 155 = ø ( Lowercase slashed zero or empty set )
ASCII code 156 = £ ( Pound sign ; symbol for the pound sterling )
ASCII code 157 = Ø ( Uppercase slashed zero or empty set )
ASCII code 158 = × ( Multiplication sign )
ASCII code 159 = ƒ ( Function sign ; f with hook sign ; florin sign )
ASCII code 160 = á ( Lowercase letter a with acute accent or a-acute )
ASCII code 161 = í ( Lowercase letter i with acute accent or i-acute )
ASCII code 162 = ó ( Lowercase letter o with acute accent or o-acute )
ASCII code 163 = ú ( Lowercase letter u with acute accent or u-acute )
ASCII code 164 = ñ ( eñe, enie, spanish letter enye, lowercase n with tilde )
ASCII code 165 = Ñ ( Spanish letter enye, uppercase N with tilde, EÑE, enie )
ASCII code 166 = ª ( feminine ordinal indicator )
ASCII code 167 = º ( masculine ordinal indicator )
ASCII code 168 = ¿ ( Inverted question marks )
ASCII code 169 = ® ( Registered trademark symbol )
ASCII code 170 = ¬ ( Logical negation symbol )
ASCII code 171 = ½ ( One half )
ASCII code 172 = ¼ ( Quarter, one fourth )
ASCII code 173 = ¡ ( Inverted exclamation marks )
ASCII code 174 = « ( Angle quotes, guillemets, right-pointing quotation mark )
ASCII code 175 = » ( Guillemets, angle quotes, left-pointing quotation marks )
ASCII code 176 = ░ ( Graphic character, low density dotted )
ASCII code 177 = ▒ ( Graphic character, medium density dotted )
ASCII code 178 = ▓ ( Graphic character, high density dotted )
ASCII code 179 = │ ( Box drawing character single vertical line )
ASCII code 180 = ┤ ( Box drawing character single vertical and left line )
ASCII code 181 = Á ( Capital letter A with acute accent or A-acute )
ASCII code 182 = Â ( Letter A with circumflex accent or A-circumflex )
ASCII code 183 = À ( Letter A with grave accent )
ASCII code 184 = © ( Copyright symbol )
ASCII code 185 = ╣ ( Box drawing character double line vertical and left )
ASCII code 186 = ║ ( Box drawing character double vertical line )
ASCII code 187 = ╗ ( Box drawing character double line upper right corner )
ASCII code 188 = ╝ ( Box drawing character double line lower right corner )
ASCII code 189 = ¢ ( Cent symbol )
ASCII code 190 = ¥ ( YEN and YUAN sign )
ASCII code 191 = ┐ ( Box drawing character single line upper right corner )
ASCII code 192 = └ ( Box drawing character single line lower left corner )
ASCII code 193 = ┴ ( Box drawing character single line horizontal and up )
ASCII code 194 = ┬ ( Box drawing character single line horizontal down )
ASCII code 195 = ├ ( Box drawing character single line vertical and right )
ASCII code 196 = ─ ( Box drawing character single horizontal line )
ASCII code 197 = ┼ ( Box drawing character single line horizontal vertical )
ASCII code 198 = ã ( Lowercase letter a with tilde or a-tilde )
ASCII code 199 = Ã ( Capital letter A with tilde or A-tilde )
ASCII code 200 = ╚ ( Box drawing character double line lower left corner )
ASCII code 201 = ╔ ( Box drawing character double line upper left corner )
ASCII code 202 = ╩ ( Box drawing character double line horizontal and up )
ASCII code 203 = ╦ ( Box drawing character double line horizontal down )
ASCII code 204 = ╠ ( Box drawing character double line vertical and right )
ASCII code 205 = ═ ( Box drawing character double horizontal line )
ASCII code 206 = ╬ ( Box drawing character double line horizontal vertical )
ASCII code 207 = ¤ ( Generic currency sign )
ASCII code 208 = ð ( Lowercase letter eth )
ASCII code 209 = Ð ( Capital letter Eth )
ASCII code 210 = Ê ( Letter E with circumflex accent or E-circumflex )
ASCII code 211 = Ë ( Letter E with umlaut or diaeresis, E-umlaut )
ASCII code 212 = È ( Capital letter E with grave accent )
ASCII code 213 = ı ( Lowercase dot less i )
ASCII code 214 = Í ( Capital letter I with acute accent or I-acute )
ASCII code 215 = Î ( Letter I with circumflex accent or I-circumflex )
ASCII code 216 = Ï ( Letter I with umlaut or diaeresis ; I-umlaut )
ASCII code 217 = ┘ ( Box drawing character single line lower right corner )
ASCII code 218 = ┌ ( Box drawing character single line upper left corner )
ASCII code 219 = █ ( Block, graphic character )
ASCII code 220 = ▄ ( Bottom half block )
ASCII code 221 = ¦ ( Vertical broken bar )
ASCII code 222 = Ì ( Capital letter I with grave accent )
ASCII code 223 = ▀ ( Top half block )
ASCII code 224 = Ó ( Capital letter O with acute accent or O-acute )
ASCII code 225 = ß ( Letter Eszett ; scharfes S or sharp S )
ASCII code 226 = Ô ( Letter O with circumflex accent or O-circumflex )
ASCII code 227 = Ò ( Capital letter O with grave accent )
ASCII code 228 = õ ( Lowercase letter o with tilde or o-tilde )
ASCII code 229 = Õ ( Capital letter O with tilde or O-tilde )
ASCII code 230 = µ ( Lowercase letter Mu ; micro sign or micron )
ASCII code 231 = þ ( Lowercase letter Thorn )
ASCII code 232 = Þ ( Capital letter Thorn )
ASCII code 233 = Ú ( Capital letter U with acute accent or U-acute )
ASCII code 234 = Û ( Letter U with circumflex accent or U-circumflex )
ASCII code 235 = Ù ( Capital letter U with grave accent )
ASCII code 236 = ý ( Lowercase letter y with acute accent )
ASCII code 237 = Ý ( Capital letter Y with acute accent )
ASCII code 238 = ¯ ( Macron symbol )
ASCII code 239 = ´ ( Acute accent )
ASCII code 240 = ≡ ( Congruence relation symbol )
ASCII code 241 = ± ( Plus-minus sign )
ASCII code 242 = ‗ ( underline or underscore )
ASCII code 243 = ¾ ( three quarters, three-fourths )
ASCII code 244 = ¶ ( Paragraph sign or pilcrow ; end paragraph mark )
ASCII code 245 = § ( Section sign )
ASCII code 246 = ÷ ( The division sign ; Obelus )
ASCII code 247 = ¸ ( cedilla )
ASCII code 248 = ° ( Degree symbol )
ASCII code 249 = ¨ ( Diaresis )
ASCII code 250 = · ( Interpunct or space dot )
ASCII code 251 = ¹ ( Superscript one, exponent 1, first power )
ASCII code 252 = ³ ( Superscript three, exponent 3, cube, third power )
ASCII code 253 = ² ( Superscript two, exponent 2, square, second power )
ASCII code 254 = ■ ( black square )
ASCII code 255 = nbsp ( Non-breaking space or no-break space )

后记

如果你觉得该方法或代码有一点点用处,可以给作者点个赞;╮( ̄▽ ̄)╭
如果你感觉方法或代码不咋地//(ㄒoㄒ)//,就在评论处留言,作者继续改进。o_O???
谢谢各位童鞋们啦( ´ ▽´ )ノ ( ´ ▽´)っ!!!

你可能感兴趣的:(Python,ASCII,python,python-docx,ascii码表,ascii,xlwt)