文章分类 -  python模块

python常用模块归纳
摘要:pyecharts具体参考:http://pyecharts.org/#/zh-cn/preparefrom pyecharts import Bar bar = Bar("我的第一个图表", "这里是副标题") add()主要方法,用于添加图表的数据和设置各种配置项 bar.add("服装", ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"], [5, 20, 3... 阅读全文
posted @ 2018-06-24 10:40 liang哥哥 阅读(1289) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python # -*- coding:utf-8 -*- import redis import MySQLdb import json def process_item(): # 创建redis数据库连接 rediscli = redis.Redis(host = "127.0.0.1", port = 6379, db = 0) ... 阅读全文
posted @ 2018-06-18 18:27 liang哥哥 阅读(80) 评论(0) 推荐(0)
摘要:from DBUtils.PooledDB import PooledDB, SharedDBConnection import pymysql class Config(object): DEBUG = False TESTING = False SECRET_KEY = 'asdfghj' DA 阅读全文
posted @ 2018-06-18 18:27 liang哥哥 阅读(665) 评论(0) 推荐(0)
摘要:import shutilimport uuiddef upload(): if request.method == "GET": return render_template('upload.html') from werkzeug.datastructures import FileStorage file_obj = request.files.ge... 阅读全文
posted @ 2018-06-18 17:00 liang哥哥 阅读(96) 评论(0) 推荐(0)
摘要:import hashlib def md5(args): hash = hashlib.md5(Config.SALT) hash.update(bytes(args, encoding='utf-8')) print(hash.hexdigest()) return hash.hexdigest 阅读全文
posted @ 2018-06-18 15:54 liang哥哥 阅读(92) 评论(0) 推荐(0)
摘要:import shutil shutil._unpack_zipfile(file.stream, '要解压的文件名') 阅读全文
posted @ 2018-06-14 22:03 liang哥哥 阅读(93) 评论(0) 推荐(0)