摘要: Function Infinite iterators (无限迭代) count() cycle() repeat() Combinatoric generators (排列组合) product() permutations() combinations() combinations_with_r 阅读全文
posted @ 2021-12-30 13:58 程序猿Time 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 以codewars中3 kyu Path Finder #3: the Alpinist 为例 题干: You are at start location [0, 0] in mountain area of NxN and you can only move in one of the four 阅读全文
posted @ 2021-12-29 23:05 程序猿Time 阅读(167) 评论(0) 推荐(0) 编辑
摘要: min() 与 max(),用法类似,都可以设置两个缺省(默认)参数,一个是key,一个是default。 其中,key参数指定实际比较对象(常用于输出字典中键值最大(小)的键); default参数设置当比较对象为empty时,输出的结果 实例(以max()函数为例): 1 # max 2 pri 阅读全文
posted @ 2021-12-28 22:57 程序猿Time 阅读(645) 评论(0) 推荐(0) 编辑
摘要: 1 import requests 2 import time 3 import csv 4 from math import ceil 5 import asyncio 6 from aiohttp import ClientSession, TCPConnector, client_except 阅读全文
posted @ 2020-03-30 11:57 程序猿Time 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 上传本地文件到Linux服务器 在Windows上安装winscp软件,下载链接:https://winscp.net/eng/download.php 如需使用其它语言界面,可下载winscp语言包,下载链接:https://winscp.net/eng/translations.php 下载语言 阅读全文
posted @ 2020-03-21 20:57 程序猿Time 阅读(626) 评论(0) 推荐(0) 编辑
摘要: 使用EPEL仓库安装 sudo yum install epel-release 用yum安装python 3.6 sudo yum install python36 安装pip yum -y install python-pip 更新pip至最新版本 pip install --upgrade p 阅读全文
posted @ 2020-03-21 20:27 程序猿Time 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 高德秘钥的设置以及检测 1 import requests 2 import time 3 import csv 4 from math import ceil 5 6 7 class KEY: 8 def __init__(self): 9 self.keys = list(csv.reader( 阅读全文
posted @ 2020-03-21 20:18 程序猿Time 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 1 from datetime import datetime 2 3 t1 = '22:21:30' 4 t2 = '23:21:25' 5 6 s = datetime.striptime(t1, '%H:%M:%S') 7 e = datetime.striptime(t2, '%H:%M:% 阅读全文
posted @ 2020-03-15 08:59 程序猿Time 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 之前,我们学习了基本库urllib的相关用法,但是在网页验证、Cookies处理等方面是比较繁琐的,需要用到Handler并且还需自己构建Opener。requests库的出现很好的解决了这个问题,下面让我们学习一下有关requests的操作。 requests的安装可以直接使用pip instal 阅读全文
posted @ 2019-04-24 08:20 程序猿Time 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 在python3中爬虫常用基本库为urllib以及requests 本文主要描述urllib的相关内容 urllib包含四个模块:requests——模拟发送请求 error——异常处理模块 parse——关于URL处理方法的工具模块 robotparser——通过识别网站robot.txt判断网站 阅读全文
posted @ 2019-04-20 22:42 程序猿Time 阅读(417) 评论(0) 推荐(0) 编辑