![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
章九章
编程小菜鸟
展开
-
fig.add_subplot(111)或者fig.add_subplot(234)的意义以及由来
解释:fig.add_subplot(xyz)是fig.add_subplot(ROW,COLUMN,POSITION)的简写形式,其第一个参数表示行数,第二个参数表示列数,第三个参数表示你正在绘制图的位置。举个例子来说:生成此图的代码是:import matplotlib.pyplot as pltfig = plt.figure()fig.add_subplot(221) #top leftfig.add_subplot(222) #top rightfig.add_subpl原创 2022-01-20 21:11:18 · 4701 阅读 · 0 评论 -
Python遇到的小问题解决办法小记
There was a problem confirming the ssl certificate问题的解决办法:pip install xx -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com其中xx是需要下载插件的名称一个保持python编码风格PEP8的插件:autopep8原创 2022-01-19 16:48:43 · 290 阅读 · 0 评论 -
为什么BeautifulSoup .children包含无名元素如换行符\n
发现问题有如下实例代码:#!/usr/bin/env python3from bs4 import BeautifulSouptest="""<!DOCTYPE html><html><head> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> <title>Test</title></head><body&原创 2021-08-14 00:26:12 · 544 阅读 · 0 评论 -
在使用BeautifulSoup的find或者find_all函数时的属性名与Python保留字冲突的问题
BeautifulSoup是Python里最受欢迎的HTML解析库之一。它可以提供一些简单的、python式的函数用来处理导航、搜索、修改分析树等功能。它是一个工具箱,通过解析文档为用户提供需要抓取的数据,因为简单,所以不需要多少代码就可以写出一个完整的应用程序。find和find_all函数find_all(tag, attributes, recursive, text, limit, keywords)find(tag, attributes, recursive, text, keyword原创 2021-08-13 11:13:47 · 223 阅读 · 0 评论 -
Python之禅
Python之禅Beautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.Complex is better than complicated.Flat is better than nested.Sparse is better than dense.Readability counts.Special cases aren't special en原创 2021-04-10 16:32:10 · 88 阅读 · 0 评论