Python
天码行空的码
这个作者很懒,什么都没留下…
展开
-
Python 刷访问量
代理IP通过https://www.xicidaili.com/wn/ 获取,我使用的的是https 协议的代理。根据自己需求选择http或者https 协议的页面。废话不多说,直接上代码。# -*- coding:utf-8 -*-#from urllib import requestimport requestsimport randomimport timeimpor...原创 2019-06-28 11:20:33 · 11672 阅读 · 2 评论 -
python random模块
random模块简介 Python标准库中的random函数可以生成随机浮点数、整数、字符串,甚至帮助你随机选择列表序列中的一个元素,打乱一组数据等。 random模块重要函数 random() 返回0<=n<1之间的随机实数n; choice(seq) 从序列seq中返回随机的元素; getrandbits(n) 以长整型形式返回n个随机位; shuf...原创 2019-07-10 18:14:53 · 9857 阅读 · 0 评论 -
python requests 模块访问https链接报错
python requests 模块访问https链接报错如下:/usr/lib/python2.6/site-packages/requests-2.9.1-py2.6.egg/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI...原创 2019-07-25 16:27:26 · 1383 阅读 · 0 评论 -
Python 备份MySQL
没有找到相关模块,使用Python +shell 方式备份数据库。# -*- coding:utf-8 -*-import os,time,datetimeDB_HOST='127.0.0.1'DB_USER='root'DB_USER_PASSWD=' 'DB_NAME='/opt/dbname.txt'BACKUP_PATH='/data/backup/'DATETI...原创 2019-08-09 14:16:02 · 9217 阅读 · 0 评论