摘要: # 如果想在打印的字符串中的任意地方加入任意的变量,可以使用python的格式化输出。## 用例代码如下:s = 'Hello'x = len(s)print("The length of %s is %d" % (s, x)) # Print :The length of Hello is 5 下 阅读全文
posted @ 2019-04-13 18:27 wolf child 阅读(9016) 评论(0) 推荐(0) 编辑
摘要: 在python3.7.1对列表的处理中,会经常使用到Python求两个list的差集、交集与并集的方法。 下面就以实例形式对此加以分析。 阅读全文
posted @ 2019-04-13 17:53 wolf child 阅读(1695) 评论(0) 推荐(0) 编辑
摘要: python中有一个轻量级的定时任务调度的库:schedule。他可以完成每分钟,每小时,每天,周几,特定日期的定时任务。因此十分方便我们执行一些轻量级的定时任务。 1 安装 1.1在cmd中输入python --version,输出结果:Python 3.7.1 1.2在cmd中输入pip ins 阅读全文
posted @ 2019-04-13 17:29 wolf child 阅读(2547) 评论(0) 推荐(0) 编辑
摘要: 1.python 利用 redis 第三方库 首先安装:pip install redis 2.reids的连接 Redis使用StrictRedis对象来管理对一个redis server 的所有连接,避免每次建立,释放连接的开销,默认,每个Redis实例都会维护一个自己的连接池。可以直接建立一个 阅读全文
posted @ 2019-04-11 23:02 wolf child 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 1.创建07_save_jpg.py文件 阅读全文
posted @ 2019-03-31 22:32 wolf child 阅读(201) 评论(0) 推荐(0) 编辑
摘要: ###获取登录后的页面三种方式: 一、实例化seesion,使用seesion发送post请求,在使用他获取登陆后的页面 二、header中添加cookies健,值为cookies字符串 三、在请求方法中添加cookies参数,接收字典形式的cookie,字典形式的cookie中的键是cookie的 阅读全文
posted @ 2019-03-31 15:44 wolf child 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 1.创建try_proxies.py文件import requestsproxies = {"http":"http:117.135.34.6:8060"}headers={"User-Agent":"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrom... 阅读全文
posted @ 2019-03-31 14:01 wolf child 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 1.在PyCharm开发工具中新建try_params.py文件; 2.try_params.py文件中编写代码: 4.安装pip install requests 执行安装(在cmd中输入pip install requests),等待安装完成 4.执行py文件; 阅读全文
posted @ 2019-03-31 11:01 wolf child 阅读(616) 评论(0) 推荐(0) 编辑
摘要: python3.7.1安装Scrapy爬虫框架 环境:win7(64位), Python3.7.1(64位) 一、安装pyhthon 详见Python环境搭建:http://www.runoob.com/python/python-install.html 二、Scrapy安装介绍 1.运行CMD, 阅读全文
posted @ 2019-03-28 18:10 wolf child 阅读(1643) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text;namespace AnyConvertx2x { /// /// 数字进制转换类 /// public class AnyC... 阅读全文
posted @ 2014-08-14 06:55 wolf child 阅读(486) 评论(0) 推荐(0) 编辑