12 2019 档案
摘要:Python保留指定位数的小数 1 ’%.2f’ %f 方法(推荐) f = 1.23456 print('%.4f' % f) print('%.3f' % f) print('%.2f' % f) 结果: 1.2346 1.235 1.23 这个方法会进行四舍五入 2 format函数(推荐)
阅读全文
摘要:# mysql链接 class LogMysql(object): conn = None cursor = None def __init__(self): # 生产 self.conn = pymysql.connect(host='root', user='datacenter', passw
阅读全文
摘要:Flask export PYTHONPATH=/opt/appgunicorn -w 4 -k gevent -b 0.0.0.0:18111 run:app Django gunicorn upload_pro.wsgi -b 0.0.0.0:19000 -w 4 &
阅读全文
摘要:python中使用excutemany执行update语句,批量更新 # coding:utf8 import pymysql import logging connection = pymysql.connect(host=HOST, port=3306, user=USER, password=
阅读全文