![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 71
楼兰0x23
happy coding !!
展开
-
Django 模型层访问关联对象 README
Django 正向访问、反向访问、一对一关系、多对一关系、多对多关系原创 2022-02-07 14:48:58 · 536 阅读 · 0 评论 -
python3花式秀操作--文件读写
0x01 输出重定向文件with open("test.txt","wt") as f: print("nihao",file=f)0x02 一句话写文件[open("test.txt","at").write(str(i)+"\n") for i in range(10)] - 解析: 此种方法需要用采用追加模式,并且每执行一次循环打开一次文件,而且无法使用上下文管理器 好处仅在只需原创 2017-09-06 21:55:51 · 375 阅读 · 0 评论 -
浅谈python3-set
0x01 set与dict>>>type({1,2,3}) <class 'set'>>>>type({1:2}) <class 'dict'>0x02 set函数简介 如果set函数参数为空,则返回一个空的set对象 如果参数是一个可迭代对象时,则返回去重的一个set对象 >>>help(set) set() -> new empty set object set(iterable) -> new原创 2017-09-19 14:28:00 · 852 阅读 · 0 评论 -
浅谈python之格式化字符串
C:\Users\Test>python --version Python 3.6.20x01 str.rjust()str.rjust # 右对齐 str.center # 居中 str.ljust # 左对齐 三个方法殊途同归,笔者在此仅介绍str.rjust方法 >>>help(str.rjust) rjust(...) S.rjust(width[, fillchar]) -> st原创 2017-10-10 00:59:36 · 1944 阅读 · 3 评论 -
python_BeautifulSoup库之遍历文档树
组别 名称 作用 输出 备注 第一组 contents 获得当前tag的所有子节点 list 注意当前是一个tag对象 - children 获得当前tag的所有子节点 list_iterator 注意当前是一个tag对象 - descendants 获得当前tag的所有子孙节点 generator 子孙节点同样返回 第二原创 2017-10-28 23:02:11 · 1582 阅读 · 0 评论 -
python_BeautifulSoup库之过滤器
0x01 概述C:\Users\Loulan>pip list --format=columns Package Version -------------- ----------- beautifulsoup4 4.6.0C:\Users\Loulan>python -V Python 3.6.2皆以find_all为例find_all(self, name=None, attrs=原创 2017-10-30 16:21:19 · 1772 阅读 · 0 评论 -
python3源码剖析之concurrent.futures.ThreadPoolExecutor
0x00 文档路径: Python » 3.6.2 Documentation » The Python Standard Library » 17. Concurrent Execution » 0x01 模块简述:添加于python3.2提供更加高效的接口来实现异步执行通过具体实现来剖析0x02 具体实现参考官方文档给出的例子from concurrent.futures import Thr原创 2017-12-15 13:54:17 · 2887 阅读 · 0 评论