随笔分类 - Python日常学习
摘要://安装python sudo yum -y install python3 //安装虚拟环境 sudo pip3 install virtualenv //创建虚拟环境 virtualenv -p /usr/bin/python3 文件夹名字 //进入虚拟环境 cd 文件夹 -->source b
阅读全文
摘要:brew install openssl export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/ pip install mysqlclient cent os # linux 前置条件 sudo apt-get install p
阅读全文
摘要:import json from datetime import datetime import MySQLdb import requests from flask import Flask, redirect, request app = Flask(__name__) class ApiError(Exception): def __init__(self, code, m...
阅读全文
摘要:import pandas as pd import requests import arrow from collections import deque import json campaign_name_deq = deque(['1'],2) ad_name_deq = deque(['1'],2) Today = arrow.now().format("YYYY-MM-DD") ...
阅读全文
摘要:filter sorted heapq counter namedtuple reduce deque pickle islice re.split endswith stat os #filter >>> aa = [1,2,3,45,6,7] >>> list(filter(lambda x:x
阅读全文
摘要:在线练习网站https://rootnroll.com/d/pipenv/
阅读全文
摘要:1、pipenv 真实环境 vs virtualenv vs pipenv 2、自定义用户模型 继承BaseUserManager和AbstractBaseUser,在settings中指定AUTH_USER_MODEL 3、优先使用通用类视图 函数视图(FBV)--> 类视图(CBV) --> 通
阅读全文
摘要:# coding=utf-8 import pandas as pd import yagmail import requests import arrow import numpy as np import matplotlib as mpl from matplotlib.font_manager import _rebuild _rebuild() # reload一下 mpl.rcP...
阅读全文
摘要:1、新建crontab_file vim输入代码*/1 * * * * /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 /Users/erick/Desktop/main.py>>/Users/erick/Desktop/d
阅读全文
摘要:import requests import time import os import arrow import pandas as pd import pandas.io.formats.excel from collections import OrderedDict import yagmail from xlsxwriter.utility import xl_rowcol_to_ce...
阅读全文
摘要:import hashlib import os def gen_md5(data): res = hashlib.md5(data.encode('utf-8')).hexdigest() return res def handel_txt(name): with open(name,'r',encoding='utf-8') as f: ...
阅读全文
摘要:aa = [{105199: 'https://picx0.jpeg'}, {105187: 'https://picx1.jpeg'}, {105170: 'https:picx2.jpeg'}, {104574: 'https://picx3.jpeg'}] from collections import ChainMap chain_dict={} for i,v in enumera...
阅读全文
摘要:import requests import json import time from pyquery import PyQuery import pandas as pd from collections import OrderedDict import multiprocessing import asyncio from functools import partial # cooki...
阅读全文
摘要:from pptx import Presentation from pptx.util import Pt, Inches prs = Presentation() slide = prs.slides.add_slide(prs.slide_layouts[1])# 添加空白页PPT body_shape = slide.shapes.placeholders body_shape[0...
阅读全文
摘要:import xlsxwriter,xlrd import glob #打开excel文件 data=xlrd.open_workbook('优秀创意库-20180725.xlsx') #获取第一张工作表(通过索引的方式) table=data.sheets()[0] def new_xlsx(): book = xlsxwriter.Workbook('pict1.xlsx') ...
阅读全文
摘要:# _*_ coding=utf-8 _*_ from PIL import Image as Img from tkinter import * from tkinter.filedialog import * from tkinter import messagebox import os # ui # ui update # business info = { 'path':[...
阅读全文
摘要:from pynput.keyboard import Listener,Controller,Key import time import threading class ComboListener: def __init__(self): self.cur_keys = [] self.keymap = { 'bbb':'w...
阅读全文
摘要:#ReadManger(c) -> (tool & context) from time import ctime import os import threading import webbrowser class ReadManager(object): def __init__(self, config): self.read_time= config[...
阅读全文
摘要:from wxpy import * import time bot = Bot() def listen(pwd): time.sleep(3) return [msg for msg in bot.messages if msg.text == pwd] def add_group(users,group): try: group.add_me...
阅读全文

浙公网安备 33010602011771号