- 博客(7)
- 收藏
- 关注
原创 Alembic无法自动转换类型(Integer, Numeric)
Alembic无法自动转换类型(Integer, Numeric) def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.execute("original sql") op.alter_column('table', '字段', existing_type=sa.VARCHAR(length=128), type_=sa.Integer(
2021-04-21 14:10:22
456
原创 python2 python3 str bytes
字符集采用的是Unicode 存储方式采用基于unicode的utf-8(当然还有utf-16,utf-32等存储方式) import sys defaultencoding = sys.getdefaultencoding() u'严'<==> unicode('严')<==> unicode('严', defaultencoding) #亦可以指定编码格式 unicode('严', 'utf-8') python2(默认的编码是ascii) unicode(采用两个字节)
2020-09-02 18:50:33
156
原创 flask 处理file对象
1. 接收file对象 reqparse parser.add_argument(‘file’,type=werkzeug.datastructures.FileStorage, location=‘files’) request.files[‘file’] 2. path = file_path + filename response = make_response(send_file(path, mimetype=‘application/octet-stream’, attachment
2020-08-28 18:51:59
2123
原创 pycharm settings
1、save to project-level dictionary —>setting->Spelling->Accepted Words 2、选中某一个文件夹,右键鼠标,底下有一个Mark direction as … [Sources Root] 3、CTRL + ALT + L —>formate code 4、CTRL + ALT + O —>optimi...
2019-11-14 16:55:19
1065
原创 install python package with a .whl file
1. https://www.lfd.uci.edu/~gohlke/pythonlibs/#jpype **2.**下载所需要的库到本地 **3.**找到下载的文件,使用pip install 文件名进行安装
2019-10-30 14:46:54
156
原创 datetime
import datetime now = datetime.datetime.now() 获取当前时间 datetime.timedelta(days=3) 设置偏移量 替换 start_time = datetime.datetime(now.year, now.month, now.day, 00, 00, 00) end_time = datetime.datetime(now.year,...
2019-10-30 14:32:12
100
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人