随笔分类 -  Python日常学习

1 2 3 4 5 ··· 7 下一页
摘要://安装python sudo yum -y install python3 //安装虚拟环境 sudo pip3 install virtualenv //创建虚拟环境 virtualenv -p /usr/bin/python3 文件夹名字 //进入虚拟环境 cd 文件夹 -->source b 阅读全文
posted @ 2020-04-16 13:05 Erick-LONG 阅读(363) 评论(0) 推荐(0)
摘要:brew install openssl export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/ pip install mysqlclient cent os # linux 前置条件 sudo apt-get install p 阅读全文
posted @ 2019-08-27 14:01 Erick-LONG 阅读(867) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2019-07-13 15:43 Erick-LONG 阅读(2043) 评论(0) 推荐(0)
摘要: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") ... 阅读全文
posted @ 2019-07-12 19:16 Erick-LONG 阅读(249) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-07-10 09:20 Erick-LONG 阅读(305) 评论(0) 推荐(0)
摘要:在线练习网站https://rootnroll.com/d/pipenv/ 阅读全文
posted @ 2019-06-19 09:09 Erick-LONG 阅读(3109) 评论(0) 推荐(0)
摘要:1、pipenv 真实环境 vs virtualenv vs pipenv 2、自定义用户模型 继承BaseUserManager和AbstractBaseUser,在settings中指定AUTH_USER_MODEL 3、优先使用通用类视图 函数视图(FBV)--> 类视图(CBV) --> 通 阅读全文
posted @ 2019-06-19 08:59 Erick-LONG 阅读(1028) 评论(0) 推荐(0)
摘要:# 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... 阅读全文
posted @ 2019-05-15 22:09 Erick-LONG 阅读(270) 评论(0) 推荐(0)
摘要:1、新建crontab_file vim输入代码*/1 * * * * /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 /Users/erick/Desktop/main.py>>/Users/erick/Desktop/d 阅读全文
posted @ 2019-04-18 14:39 Erick-LONG 阅读(981) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2019-02-11 11:03 Erick-LONG 阅读(2619) 评论(0) 推荐(0)
摘要: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: ... 阅读全文
posted @ 2018-12-27 20:36 Erick-LONG 阅读(166) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2018-08-09 16:07 Erick-LONG 阅读(452) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2018-08-03 18:21 Erick-LONG 阅读(348) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2018-07-30 14:06 Erick-LONG 阅读(4137) 评论(0) 推荐(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') ... 阅读全文
posted @ 2018-07-30 13:59 Erick-LONG 阅读(970) 评论(0) 推荐(0)
摘要:# _*_ 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':[... 阅读全文
posted @ 2018-07-04 13:33 Erick-LONG 阅读(163) 评论(0) 推荐(0)
摘要:from pynput.keyboard import Listener,Controller,Key import time import threading class ComboListener: def __init__(self): self.cur_keys = [] self.keymap = { 'bbb':'w... 阅读全文
posted @ 2018-06-26 13:26 Erick-LONG 阅读(136) 评论(0) 推荐(0)
摘要:#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[... 阅读全文
posted @ 2018-06-25 13:36 Erick-LONG 阅读(114) 评论(0) 推荐(0)
摘要:sconfig.py 阅读全文
posted @ 2018-06-25 13:35 Erick-LONG 阅读(118) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2018-06-14 13:47 Erick-LONG 阅读(184) 评论(0) 推荐(0)

1 2 3 4 5 ··· 7 下一页