ASCII Table and Description

本文介绍了ASCII码的基本概念,包括其历史背景、字符集及其数值表示。此外还解释了ASCII码如何被用于计算机中,并且提到了扩展ASCII码的相关信息。

ASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation of a character such as 'a' or '@' or an action of some sort. ASCII was developed a long time ago and now the non-printing characters are rarely used for their original purpose. Below is the ASCII character table and this includes descriptions of the first 32 non-printing characters. ASCII was actually designed for use with teletypes and so the descriptions are somewhat obscure. If someone says they want your CV however in ASCII format, all this means is they want 'plain' text with no formatting such as tabs, bold or underscoring - the raw format that any computer can understand. This is usually so they can easily import the file into their own applications without issues. Notepad.exe creates ASCII text, or in MS Word you can save a file as 'text only'

Extended ASCII Codes

参考链接:

1. Ascii Table - ASCII character codes and html, octal, hex and decimal chart conversion
http://www.asciitable.com/

import sqlite3 import json try: # 连接到 SQLite 数据库 conn = sqlite3.connect('myWords_v5.db') cursor = conn.cursor() # 检查表名是否正确 table_name = 'actual_table_name' query = f"SELECT * FROM {table_name} WHERE name LIKE '%新课标%' AND level_name = '初中' AND `def` IS NOT NULL" cursor.execute(query) # 获取查询结果 results = cursor.fetchall() # 获取列名 column_names = [description[0] for description in cursor.description] except sqlite3.Error as e: print(f"数据库操作出错: {e}") results = [] # 若出现错误,将 results 初始化为空列表 finally: # 关闭游标和连接 if cursor: cursor.close() if conn: conn.close() # 将查询结果转换为字典列表 data = [] if results: for row in results: row_dict = dict(zip(column_names, row)) data.append(row_dict) # 将数据保存为 JSON 文件 try: with open('output.json', 'w', encoding='utf-8') as f: json.dump(data, f, ensure_ascii=False, indent=4) print("数据已成功保存为 output.json") except Exception as e: print(f"保存 JSON 文件时出错: {e}") import sqlite3 import json try: # 连接到 SQLite 数据库 conn = sqlite3.connect('myWords_v5.db') cursor = conn.cursor() # 检查表名是否正确 table_name = 'actual_table_name' query = f"SELECT * FROM {table_name} WHERE name LIKE '%新课标%' AND level_name = '初中' AND `def` IS NOT NULL" cursor.execute(query) # 获取查询结果 results = cursor.fetchall() # 获取列名 column_names = [description[0] for description in cursor.description] except sqlite3.Error as e: print(f"数据库操作出错: {e}") results = [] # 若出现错误,将 results 初始化为空列表 finally: # 关闭游标和连接 if cursor: cursor.close() if conn: conn.close() # 将查询结果转换为字典列表 data = [] if results: for row in results: row_dict = dict(zip(column_names, row)) data.append(row_dict) # 将数据保存为 JSON 文件 try: with open('output.json', 'w', encoding='utf-8') as f: json.dump(data, f, ensure_ascii=False, indent=4) print("数据已成功保存为 output.json") except Exception as e: print(f"保存 JSON 文件时出错: {e}")
最新发布
10-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

snaking616

你的鼓励是我最大的动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值