摘要: from decimal import Decimal, getcontext# getcontext().prec设置有效数字的个数getcontext().prec = 2# 四舍五入,保留几位小数a = str(Decimal(0.5811966).quantize(Decimal('0.00 阅读全文
posted @ 2022-11-09 12:06 黑山老道 阅读(27) 评论(0) 推荐(0) 编辑
摘要: pymysql直接插入带有双引号或单引号的字符串,报错: pymysql.err.ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MyS 阅读全文
posted @ 2022-11-09 11:36 黑山老道 阅读(430) 评论(0) 推荐(0) 编辑