摘要: flask_sqlalchemy 与 sqlserver #代码:通过cursor方式调用 from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() connection = db.engine.raw_connection() cursor 阅读全文
posted @ 2021-11-26 23:43 决明子~ 阅读(320) 评论(0) 推荐(0) 编辑
摘要: python中有一个zfill方法用来给字符串前面补0,非常有用Python zfill() 方法返回指定长度的字符串,原字符串右对齐,前面填充0。 语法格式:str.zfill(width),width指定字符串的长度 1 #view sourceprint? 2 n = "123" 3 s = 阅读全文
posted @ 2021-11-26 23:40 决明子~ 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 例子一:获取HTTP请求响应码 import urllib.requestheader={"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.335 阅读全文
posted @ 2021-11-26 23:30 决明子~ 阅读(588) 评论(0) 推荐(0) 编辑
摘要: HTTP响应状态码表 1xx: 信息100 Continue服务器仅接收到部分请求,但是一旦服务器并没有拒绝该请求,客户端应该继续发送其余的请求。101 Switching Protocols服务器转换协议:服务器将遵从客户的请求转换到另外一种协议。 2xx: 成功200 OK请求成功(其后是对GE 阅读全文
posted @ 2021-11-26 23:27 决明子~ 阅读(38) 评论(0) 推荐(0) 编辑
摘要: json遇到Decimal 型数据无法正确处理解决方案import json result = [ {'name': '小红', 'age': 26, 'balance': decimal.Decimal(21.56)}, {'name': '小明', 'age': 24, 'balance': d 阅读全文
posted @ 2021-11-26 23:17 决明子~ 阅读(542) 评论(0) 推荐(0) 编辑