摘要: 利用切片操作,实现一个trim()函数,去除字符串首尾的空格,不调用str的strip()方法 阅读全文
posted @ 2019-02-26 20:05 Adeline~ 阅读(164) 评论(0) 推荐(0)
摘要: from bs4 import BeautifulSoup from colorama import init,Fore,Back,Style init(autoreset=True) #f = open('html.html', 'w') f = ''' w3school 在线教程 ... 阅读全文
posted @ 2019-02-24 12:06 Adeline~ 阅读(209) 评论(0) 推荐(0)
摘要: 父子孙 阅读全文
posted @ 2019-02-24 01:03 Adeline~ 阅读(509) 评论(0) 推荐(0)
摘要: 匹配测试 . 匹配除\n换行符之外的任何单个字符。 [ ] 匹配括号中的任何一个字符。 如果要想匹配二十六个英文字母中的任意一个怎么写呢? a[a-z]b 如果也想匹配大写的A—Z的话,需要这么写 a[a-zA-Z]b | 将两个匹配条件进行逻辑“或”运算。 如a[a|b]b z|food 要么是z 阅读全文
posted @ 2019-02-22 13:58 Adeline~ 阅读(97) 评论(0) 推荐(0)
摘要: import socket from urllib import request,error try: response = request.urlopen('https://cuiqingcai.com/index/htm',timeout=0.01) except error.HTTPError as e: #先捕获子类错误HTTPError print(e.reas... 阅读全文
posted @ 2019-02-21 23:41 Adeline~ 阅读(176) 评论(0) 推荐(0)
摘要: 官方文档 阅读全文
posted @ 2019-02-21 23:36 Adeline~ 阅读(164) 评论(0) 推荐(0)