摘要:https://www.lfd.uci.edu/~gohlke/pythonlibs/ http://mirrors.aliyun.com/pypi/simple
阅读全文
摘要:# coding=utf-8import bottle @bottle.route('/url/url', method=['GET','POST'])def big_data(): # 获取请求参数 trans_user_type = bottle.request.GET.get('trans_u
阅读全文
摘要:一、安装环境 1. 查看是否安装了virtualenv virtualenv --version 2. 安装虚拟环境 pip install virtualenv pip install virtualenvwrapper 3. 若提示找不到mkvirtualenv命令,需配置环境变量 1)创建目录
阅读全文
摘要:1. 字典排序 d={'a':1,'c':3,'b':2} d1={k:d[k] for k in sorted(d)}
阅读全文
摘要:# coding=utf-8 import os import time path = os.getcwd() index = 0 while True: # 当前时间戳 timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
阅读全文
摘要:# coding=utf-8 import re import os path = os.path.abspath('.') def all_path(dirname): result = [] for maindir, subdir, file_name_list in os.walk(dirna
阅读全文
摘要:一、是否安装了virtualenv:virtualenv —version 二、安装虚拟环境: pip install virtualenvpip install virtualenvwrapper 三、配置 virtualenv:1. mkdir $HOME/.virtualenvs 2. vim
阅读全文
摘要:1. 修改字符集参数,一般这种情况出现得较多是在国标码(GBK)和utf8之间选择出现了问题。 2. 出现异常报错是由于设置了decode()方法的第二个参数errors为严格(strict)形式造成的,因为默认就是这个参数,将其更改为ignore等即可。例如: b"\xac\xed\x00\x05
阅读全文
摘要:import datetime timeNow = datetime.datetime.now() # 当前日期 today = timeNow.strftime('%Y%m%d%H%M%S') # 昨天 yesterday = (timeNow - datetime.timedelta(days=1)).strftime('%Y%m%d%H%M%S') # 二十天前 twentyDaysAg...
阅读全文
摘要:https://www.cnblogs.com/zelos/p/7439599.html
阅读全文
摘要:files = {'file': open('test11.log', 'rb')}res = requests.post( url, data={ 'key1': value, 'key2': value, 'key3': value }, files=files)
阅读全文
摘要:转自:http://blog.csdn.net/woshisangsang/article/details/74360612
阅读全文
摘要:1. 安装openpyxl模块 pip install openpyxl 2. 代码 获取最大行列值 print(table.max_row)print(table.max_column) 参考: https://www.cnblogs.com/sun-haiyu/p/7096423.html xl
阅读全文
摘要:Python 异常处理之处理默认错误类型以外错误
阅读全文
摘要:一. Python 冒泡法排序def sequence(arrays=list()): def desc(): for i in range(1, len(arrays)): for j in range(len(arrays) - i): if arrays[j] arrays[j + 1]: ...
阅读全文