- 博客(285)
- 收藏
- 关注
转载 ffmpeg下载m3u8流媒体
安装编译好的windows可用版本的下载地址(官网中可以连接到这个网站,和官方网站保持同步):http://ffmpeg.zeranoe.com/builds/该版本为FFMPEG的Static,Static里面只有3个应用程序:ffmpeg.exe,ffplay.exe,ffprobe.exe,每个exe的体积都很大,相关的Dll已经被编译到exe里面去了。使用ffm...
2019-09-19 14:04:00
843
转载 middlewares.py
1.数据需要selenium解析后才能呈现# middlewares.pyfrom scrapy import signalsimport scrapyfrom selenium import webdriverfrom selenium.webdriver.chrome.options import Optionsimport timeclass...
2019-09-09 16:45:00
316
转载 Python-doc .rst文件打开
Python rst文件打开RST与Python类似Javadoc与Java.如果下载了别人的Python源码,里面有rst文件夹,我们可以转为html后用浏览器打开某个开源项目的index.rst1.安装python的sphinx模块:pip install recommonmarkpip install sphinxpip in...
2019-09-09 10:20:00
575
转载 Scrapy-splash
Scrapy-splashSplash是一个javascript渲染服务。它是一个带有HTTP API的轻量级Web浏览器,使用Twisted和QT5在Python 3中实现。QT反应器用于使服务完全异步,允许通过QT主循环利用webkit并发。一些Splash功能:并行处理多个网页获取HTML源代码或截取屏幕截图关闭图像或使用Adblock Plus规则使渲染更快...
2019-09-06 15:12:00
392
转载 windows 安装mongodb
下载地址:http://dl.mongodb.org/dl/win32可视化:https://nosqlbooster.com/downloads转载于:https://www.cnblogs.com/yoyo1216/p/11474419.html
2019-09-06 13:46:00
123
转载 django DeleteView
DeleteViewfrom django.urls import reverse, reverse_lazyfrom django.contrib.auth.mixins import LoginRequiredMixinfrom django.views.generic import ListView, View, DeleteViewclass News...
2019-08-28 15:31:00
659
转载 django ListView
ListViewfrom django.contrib.auth.mixins import LoginRequiredMixinfrom django.views.generic import ListViewfrom apps.news.models import Newsclass NewsListView(LoginRequiredMixin, L...
2019-08-28 13:59:00
204
转载 pycharm 设置django server
转载于:https://www.cnblogs.com/yoyo1216/p/11394800.html
2019-08-22 15:51:00
566
转载 centos7虚拟机端口命令
Centos7端口常见命令虚拟机新开了5005端口,系统内部是显示开了的,但是外部不能访问端口。一些需要用到的命令:1、firewalld的基本使用启动: systemctl start firewalld查看状态: systemctl status firewalld / firewall-cmd --state 这个命令也可以,只是信息会简单点停止: syst...
2019-08-22 15:40:00
2691
转载 解决Django-Error: That port is already in use
Error: That port is already in use.1.使用python manage.py runserver 8001 开一个新的端口。 2.kill掉原来的端口(在root条件下)。 2.1在终端输入lsof -i:8000,列出进程信息。yum install lsof 2.2然后,找到进程的PID号,比如我的PID号就...
2019-08-22 10:50:00
142
转载 mysql报错
centos 安装mysqlclient报错pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmp7ax9dy_mbuild/mysqlclient/解决方案...
2019-08-21 14:42:00
172
转载 pipenv
1.安装pipenvpip3.6 install pipenv2.创建虚拟环境pipenv --python 3.6 # 指定python3.6版本3.安装包cd myorject # 进入项目目录pipenv install django4.安装完成后会在项目目录生成两个文件vi Pipfile[[so...
2019-08-20 14:24:00
120
转载 merge
1.mergedef merge(left, right, how="inner", on=None, left_on=None, right_on=None, left_index=False, right_index=False, sort=False, suffixes=("_x", "_y"), copy=True, indicator=False, validate=N...
2019-08-16 14:21:00
172
转载 pandas 基本操作
1.import pandas as pdimport numpy as npdf1 = pd.DataFrame(np.arange(12).reshape(3, 4))df2 = pd.DataFrame(np.arange(20).reshape(4, 5))print(df1)print(df2)print(df1.add(df2, fill_...
2019-08-15 10:26:00
196
转载 to_sql, to_csv, to_excel, to_json
1.to_sqldef to_sql(self, name, con, schema=None, if_exists="fail", index=True, index_label=None, chunksize=None, dtype=None, method=None,): name: 输出的表名 con: 数据库连接对象 ...
2019-08-14 10:12:00
572
转载 read_sql_query, def read_sql_table
read_sql_query,read_sql_tabledef read_sql_query(sql, con, index_col=None, coerce_float=True, params=None, parse_dates=None, chunksize=None): sql: mysql 语句 con: 数据库连接对象 index_c...
2019-08-12 15:16:00
389
转载 cookiecutter
1.安装cookiecutterpip3 install cookiecutter2.设置模板https://github.com/cookiecutter/cookiecutter 搜索需要的模板cookiecutter https://github.com/pydanny/cookiecutter-django或者从https://gith...
2019-08-06 16:49:00
898
转载 pycharm 远程连接
1.连接远程项目2.连接远程服务器转载于:https://www.cnblogs.com/yoyo1216/p/11309006.html
2019-08-06 15:03:00
98
转载 aiohttp_spider
aiohttp_spider_def:import asyncioimport reimport aiohttpimport aiomysqlfrom pyquery import PyQueryfrom lxml import etreestart_url = 'http://news.baidu.com/'waitting_urs = []...
2019-08-05 16:09:00
205
转载 mysql autocommit
当autocommit为开启状态时,即使没有手动start transaction开启事务,mysql默认也会将用户的操作当做事务即时提交(自动帮我们 db.commit())autocommit开启时,mysql的插入效率会提高1.autocmmit=Falseimport pymysqlimport timedef mysql_autpcommit()...
2019-08-05 14:58:00
138
转载 ADB端口5037被占用 导致adb 停止工作
解决ADB端口占用问题方式一5037为adb默认端口,若5037端口被占用,打开cmd,输入以下指令,1.查看占用端口的进程PID netstat -aon|findstr 50372. 通过PID查看所有进程 tasklist /fi "PID eq 3704"3. 杀死占用端口的进程taskkill /pid 3704 /fC:\Users\10...
2019-08-05 14:45:00
367
转载 aiomysql
aiomysql:import aiomysqlimport asyncioasync def aiomysql_test(): loop = asyncio.get_event_loop() # 第一种连接方法 pool = await aiomysql.create_pool(host='127.0.0.1', port=3306...
2019-08-02 16:08:00
368
转载 headers
headers:# Windows 10 IE 11.0headers = {"User-Agent" : "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"}# Chrome 59.9headers = {"User-Agent" : "Mozilla/5.0 (Wi...
2019-08-01 16:56:00
522
转载 aiohttp
1. aiohttp安装pip3 install aiohttp1.1. 基本请求用法async with aiohttp.get('https://github.com') as r: await r.text()其中r.text(), 可以在括号中指定解码方式,编码方式,例如await resp.text(encoding='...
2019-08-01 16:44:00
150
转载 thread_asyncio
thread_asyncio# 使用多线程:在携程中集成阻塞ioimport asynciofrom concurrent.futures import ThreadPoolExecutorimport socketfrom urllib.parse import urlparsedef get_url(url): # 通过socket请求h...
2019-07-24 13:50:00
243
转载 socket服务
1.socket_serverimport socketimport threadingserver = socket.socket(socket.AF_INET, socket.SOCK_STREAM)server.bind(('0.0.0.0', 8000))server.listen()def handle_sock(sock, add...
2019-07-24 13:48:00
194
转载 socket_http
socket_httpimport socketfrom urllib.parse import urlparseimport timedef get_url(url): # 通过socket请求html url = urlparse(url) # 解析url host = url.netloc # 获取ip地址 p...
2019-07-24 13:29:00
76
转载 asyncio
asyncio是python用于解决异步io编程的一整套解决方案1.使用asyncioimport asyncioimport timeasync def get_html(url): print("start get url") await asyncio.sleep(2) # 耗时操作 要加await print("end get...
2019-07-24 09:47:00
82
转载 async await
1.async await# python为了将语义变得更加明确,就引入了async和await关键词用于定义原生的协程import typesasync def downloader(url): return "bobby"@types.coroutinedef downloader(url): yield "bobby"...
2019-07-23 14:48:00
83
转载 yield_from
python3.3 新加的yield from 语句1.yield fromdef my_chain(*args, **kwargs): for my_iterable in args: yield from my_iterable # yield from 相当于下面的: # for value in my_...
2019-07-23 14:14:00
91
转载 ProxyPool 代理
ProxyPool:https://github.com/yucaifuyoyo/ProxyPoolgithub上一个开源项目的proxypool添加一些免费代理IP网站1.https://www.kuaidaili.com/free/inha/1/ # 快代理2.http://www.xicidaili.com/wt/1 # 西刺免费代理IP3.h...
2019-07-23 13:28:00
375
转载 Async/Await
Async/Await入门指南:https://zhuanlan.zhihu.com/p/27258289import asyncioimport randomclass Potato: @classmethod def make(cls, num, *args, **kws): potatos = [] f...
2019-07-18 16:06:00
77
转载 Dockerfile
1.centos带python环境pip3.6 freeze > plist.txtwget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgzFROM centosLABEL maintainer="yu"RUN yum -y updateRUN yum install -y opens...
2019-07-17 14:42:00
80
转载 药学宝
01-yxb.pyimport timefrom YDM import YDMHttpimport requestsimport timeimport pymysqlimport loggingimport jsonfrom file_handle import wite_to_excel_textfrom email.mime.text impo...
2019-07-16 17:10:00
373
转载 云打码
云片:http://www.yundama.com/1.云打码使用# coding:utf-8import json, time, requestsclass YDMHttp: apiurl = 'http://api.yundama.com/api.php' username = '' password = '' ap...
2019-07-16 14:10:00
287
转载 docker 部署appium
1.docker appium镜像和命令:https://github.com/appium/appium-docker-android2.启动appiumdocker run --privileged -d -p 4723:4723 -v ~/.android:/root/.android -v /dev/bus/usb:/dev/bus/usb --name appium...
2019-07-15 16:23:00
3058
转载 Anaconda 下载
Anaconda官网:https://repo.anaconda.com/archive/清华大学镜像站:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/?C=N&O=DC:\01-python\06-Anaconda Python需要C:\01-python\06-Anaconda...
2019-07-11 09:56:00
84
转载 开心聊聊天信息爬取
开心聊聊天信息# _*_ coding:UTF-8import timefrom selenium.webdriver.support.ui import WebDriverWaitfrom appium import webdriverimport reimport pymysqlimport smtplibfrom email.mime.text ...
2019-07-05 13:21:00
274
转载 利用163 邮箱发送邮件
1.利用163邮箱发送邮件# _*_ coding:UTF-8import timeimport smtplibfrom email.mime.text import MIMETextfrom email.mime.multipart import MIMEMultipartdef sentemail(): caodate = str(tim...
2019-07-05 11:12:00
604
转载 pycharm 有汉字的地方就有阴影
1.pycharm 有汉字的地方就有阴影编码申明 阴影就会消失 # _*_ coding:UTF-8转载于:https://www.cnblogs.com/yoyo1216/p/11137055.html
2019-07-05 11:04:00
601
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人