随笔分类 - python
摘要:Pymysql https://pymysql.readthedocs.io/en/latest/user/examples.html 官方文档 INSTALL $ python3 -m pip install PyMySQL #Requirements Python – one of the fo
阅读全文
posted @ 2020-07-18 20:06
Lust4Life
摘要:Python 时间Arrow pip install arrow 当前时间 import arrow t = arrow.utcnow() print(t) 2020-07-11T09:27:11.058088+00:00 arrow.now() <Arrow [2020-07-11T17:27:4
阅读全文
posted @ 2020-07-11 17:45
Lust4Life
摘要:2020-7-4 基础知识学习 https://www.readwithu.com/Article/codeSpecification/codeSpecification_Preface.html 可是化运行python代码 http://www.pythontutor.com/visualize.
阅读全文
posted @ 2020-07-04 16:31
Lust4Life
摘要:《Python 3 标准库实例教程》 https://learnku.com/docs/pymotw/introduce/3357 python 编码规范 编码规范的好处: 有助于增强代码的一致性和可读性。代码被阅读的次数远大于它被编写的次数,良好的遵循编码规范可以保证代码在一个项目中,甚至多个项目
阅读全文
posted @ 2020-06-29 21:47
Lust4Life
摘要:此文档作废,因为从拉钩获取的经纬度与百度的坐标系统不一致,导致定位有差别. 使用帮助 百度地图坐标拾取系统 http://api.map.baidu.com/lbsapi/getpoint/index.html 根据地点获取经纬度,或根据经纬度获取地址 百度地图显示多个标注点 https://blo
阅读全文
摘要:python retrying库 def __init__(self, stop=None, wait=None, stop_max_attempt_number=None, stop_max_delay=None, wait_fixed=None, wait_random_min=None, wa
阅读全文
posted @ 2020-06-26 13:21
Lust4Life
摘要:supervisor可以默认使用Python2, 案例使用了离线安装 虽然测试了,但是实际上安装pip 和 supervisor 中有意外产生,离线安装pip 时最好使用yum安装,rpm 有时会失败 目录结构: [root@mini-install supervisor]# tree . ├──
阅读全文
posted @ 2020-06-19 18:30
Lust4Life
摘要:##python2 使用supervisor监控执行脚本,脚本意外退出后可被立即拉起 使用Python2 是因为系统默认的python版本, 不需要重新安装新版Python ###安装pip #离线包 [root@localhost pipackage]# ls -1 python2-pip-8.1
阅读全文
posted @ 2020-06-17 10:02
Lust4Life
摘要:##根据毫秒计算 cat test.py import time, datetime, commands ## #get time use shell command : date +'%Y-%m-%d %H:%M:%S' then set the value of old_time ## # ol
阅读全文
posted @ 2020-06-16 18:20
Lust4Life
摘要:通过该程序监控相关进程,如果进程死亡,就重新启动 1,安装python yum -y install python36 #离线安装,安装完后修改配置本机默认的版本为python3 ,还必须修改yum 的配置文件,使其使用旧的python版本 2,安装Supervisor 下载离线包安装 wget h
阅读全文
posted @ 2020-06-15 19:59
Lust4Life
摘要:yum默认使用python2, 更改系统默认Python为Python3后需要对yum的文件进行修改 ##安装高版本Python yum -y install python36 #离线安装 yum -y install yum-utils yumdownloader python36 --resol
阅读全文
posted @ 2020-06-15 15:13
Lust4Life
摘要:按照说明,将代码打入该镜像内启动 https://github.com/tiangolo/uwsgi-nginx-docker
阅读全文
posted @ 2020-06-05 17:53
Lust4Life
摘要:创建的虚拟环境的python版本前提是必须在电脑上必须存在 virtualenv 使用Virtualenvwrapper Virtaulenvwrapper是virtualenv的扩展包,用于更方便管理虚拟环境,它可以做: 将所有虚拟环境整合在一个目录下 管理(新增,删除,复制)虚拟环境 快速切换虚
阅读全文
摘要:获取歌词 https://www.cnblogs.com/weixuqin/p/8905867.html https://www.zhihu.com/question/36081767 http://music.163.com/api/v1/resource/comments/R_SO_4_5169
阅读全文
摘要:通过user_agent 和url判断网页是否可爬
阅读全文
摘要:使用工具 png 用Python的mutagen模块获取MP3音频文件的时长 https://blog.csdn.net/u011519550/article/details/84981585 操作历史
阅读全文
摘要:报错: https://stackoverflow.com/questions/48509732/amazon web services bash activate no such file or directory
阅读全文
摘要:文档:https://loguru.readthedocs.io/en/stable/overview.html#installation pip install loguru ##使用 ###基本使用 ##终端日志 from loguru import logger logger.debug("这
阅读全文
摘要:官网文档 https://docs.python.org/zh-cn/3/library/argparse.html#module-argparse https://www.jianshu.com/p/fef2d215b91d 基本使用流程 #1创建解析器 #ArgumentParser 对象包含将
阅读全文
摘要:hasattr(object, name) 判断一个对象里面是否有name属性或者name方法,返回BOOL值,有name特性返回True, 否则返回False。 getattr(object, name[,default]) 获取对象object的属性或者方法,如果存在打印出来,如果不存在,打印出
阅读全文

浙公网安备 33010602011771号