04 2020 档案

摘要:from bson.objectid import ObjectId 1、字符串转ObjectId oid = ObjectId(id_str); 2、ObjectId转字符串 id_str = ObjectId(id).toString() 例子 find({'_id': ObjectId(id_ 阅读全文
posted @ 2020-04-23 17:04 阿磊小哥哥呀 阅读(1511) 评论(0) 推荐(0)
摘要:Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWar 阅读全文
posted @ 2020-04-23 09:52 阿磊小哥哥呀 阅读(925) 评论(0) 推荐(0)
摘要:参考链接:https://zhuanlan.zhihu.com/p/88122986 import backoff import time @backoff.on_predicate(backoff.fibo) def test2(): print("time is {}, retry...".fo 阅读全文
posted @ 2020-04-22 16:46 阿磊小哥哥呀 阅读(1094) 评论(0) 推荐(0)
摘要:import logging from logging import handlers class Logger(object): level_relations = { 'debug': logging.DEBUG, 'info': logging.INFO, 'warning': logging 阅读全文
posted @ 2020-04-22 16:40 阿磊小哥哥呀 阅读(1549) 评论(0) 推荐(0)
摘要:you get u url u 是视频的详细信息及地址 json 是详细信息格式化 i是视频的详细信息没有地址 url是视频地址,不是视频加密的地址 以上是cmd命令行 转化为MP4格式:you get itag=18 '视频地址URL' 至于python怎么获取结果可以参考: https://ww 阅读全文
posted @ 2020-04-20 10:35 阿磊小哥哥呀 阅读(612) 评论(0) 推荐(0)
摘要:res = os.popen("cmd命令") tempstream = res._stream print(tempstream.buffer.read().decode(encoding='utf 8')) s = tempstream.buffer.read().decode(encoding 阅读全文
posted @ 2020-04-20 10:32 阿磊小哥哥呀 阅读(1625) 评论(0) 推荐(0)
摘要:导入pymongo并选择要操作的集合 数据库和集合乜有会自动创建 from pymongo import MongoClient client = MongoClient(host,port) collection = client[db名][集合名] 添加一条数据 ret = collection 阅读全文
posted @ 2020-04-17 09:17 阿磊小哥哥呀 阅读(873) 评论(0) 推荐(0)
摘要:""" https://fastapi.tiangolo.com/project-generation/cors中间件处理跨域 """ from fastapi import FastAPI from pydantic import BaseModel from starlette.middlewa 阅读全文
posted @ 2020-04-17 09:15 阿磊小哥哥呀 阅读(5969) 评论(0) 推荐(0)
摘要:#打包 pip freeze >requirements.txt # 安装 pip install -r requirements.txt 阅读全文
posted @ 2020-04-16 13:29 阿磊小哥哥呀 阅读(630) 评论(0) 推荐(0)
摘要:def save_data(item, sheet): """ 数据保存 :param item: 数据 :param sheet: sheet名 :return: """ dfscores = pd.DataFrame(item) # 写入数据 encoding="utf-8-sig" 看情况而用 阅读全文
posted @ 2020-04-16 09:40 阿磊小哥哥呀 阅读(2124) 评论(0) 推荐(0)
摘要:def save_data(item, sheet): """ 数据保存 :param item: 数据 :param sheet: sheet名 :return: """ dfscores = pd.DataFrame(item) # 写入数据 encoding="utf-8-sig" 看情况而用 阅读全文
posted @ 2020-04-13 17:58 阿磊小哥哥呀 阅读(633) 评论(0) 推荐(0)
摘要:# 默认第一个sheetpath = './new_statistics.xlsx' data = pd.DataFrame(pd.read_excel(path)) project = data['项目名称'] # 列名# 指定sheet data = pd.DataFrame(pd.read_e 阅读全文
posted @ 2020-04-13 17:16 阿磊小哥哥呀 阅读(459) 评论(0) 推荐(0)
摘要:#第一步:调用pandas包 import pandas as pd #第二步:读取数据 iris = pd.read_excel('./statistics.xlsx',None)#读入数据文件 keys = list(iris.keys()) #第三步:数据合并 iris_concat = pd 阅读全文
posted @ 2020-04-13 15:24 阿磊小哥哥呀 阅读(1338) 评论(0) 推荐(0)