上一页 1 ··· 8 9 10 11 12 13 下一页
摘要: 命名切片 c = slice(2, 5) a = [1, 2, 3, 4, 5, 6, 7] print(a[c]) 阅读全文
posted @ 2020-12-09 14:30 rm-rf* 阅读(108) 评论(0) 推荐(0)
摘要: git相关命令 基本操作 git init git add xxx git commit -m "first commit" git tag -a V1.0 -m '我的标签' git remote add origin git@github.com:xxx/spider.git 建立远程仓库连接 阅读全文
posted @ 2020-12-09 14:28 rm-rf* 阅读(220) 评论(0) 推荐(0)
摘要: python解析命令行参数 import click @click.command() # 使函数解析命令行 @click.option("--id", help="用户名") # 命令行添加参数 def delete(id): """ 删除用户 :param id: :return: """ cl 阅读全文
posted @ 2020-12-09 14:27 rm-rf* 阅读(182) 评论(0) 推荐(0)
摘要: 数据可视化 使用pyecharts API文档 import math from pyecharts import options as opts from pyecharts.charts import Surface3D from pyecharts.globals import ThemeTy 阅读全文
posted @ 2020-12-09 14:26 rm-rf* 阅读(168) 评论(0) 推荐(0)
摘要: 为什么不能用可变对象作为默认参数的值 看一个例子 def abc(a, b): b.append(a) print(b) return b if __name__ == '__main__': abc(1, []) abc(2, []) abc(3, []) 结果和预期的一样: [1] [2] [3 阅读全文
posted @ 2020-12-09 14:25 rm-rf* 阅读(165) 评论(0) 推荐(0)
摘要: Python 表达式 i += x 与 i = i + x 等价吗? 看个例子 a = [1, 2, 3] b = a # 写法一 b += [4] # 写法二 # b = b + [4] print(id(a), a) print(id(b), b) 两种不同的写法,结果不一致 写法一结果: 23 阅读全文
posted @ 2020-12-09 14:24 rm-rf* 阅读(146) 评论(0) 推荐(0)
摘要: Python的数据缓存 python 的内置数据类型,数值型,字符串,列表,字典等都会有自己的对象缓存池, 这样做的好处是,避免了频繁的申请内存,释放内存,这样会极大的降低应用程序的运行速度,还会造成大量的内存碎片。因此提供对象缓存机制是非常重要的。 在Python中,字符串和整型对象都是不可变的( 阅读全文
posted @ 2020-12-09 14:23 rm-rf* 阅读(1546) 评论(2) 推荐(0)
摘要: 安装scrapy centos 7 安装scrapy报错说找不到scrapy需要的Twisted13.0以上版本? Collecting Twisted>=13.1.0 (from Scrapy) Could not find a version that satisfies the require 阅读全文
posted @ 2020-12-09 14:22 rm-rf* 阅读(88) 评论(0) 推荐(0)
摘要: 异步调用(坑) from concurrent.futures import ThreadPoolExecutor executor = ThreadPoolExecutor(5) def review(): '''省略过程''' #异步提交任务 executor.submit(call_crawl 阅读全文
posted @ 2020-12-09 14:21 rm-rf* 阅读(102) 评论(0) 推荐(0)
摘要: linux系统添加用户 增加用户: useradd -d /usr/username -m username 为用户增加密码: passwd username 新建工作组: groupadd groupname 将用户添加进工作组: usermod -G groupname username 删除用 阅读全文
posted @ 2020-12-09 14:20 rm-rf* 阅读(119) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 下一页