python Flask :TypeError: 'dict' object is not callable
摘要:flask 基于Werkzeug ..@moudule.route('/upload', methods=['GET', 'POST'])def upload_file(): global _flask_app if request.method == 'POST': file = request.files['file'] if file and allowed_file(file.filename): filename = secure_filename(file.filename) file.save(...
阅读全文
python 二进制读写文件
摘要:#-*- coding: utf-8 -*-f = open('f:/text.bmp','rb')filedata = f.read()filesize = f.tell()f.close()filedata2 = bytearray(filedata)width = filedata2[18]height = filedata2[22]print('width:', width)print('height:', height) # less than 255 , width and height have 4 bytespri
阅读全文