摘要:
import reprint(re.findall('alex','hahahah alex is alex is dsb')) alexprint(re.findall('\w','Aah123 +-_')) 匹配字母数字下划线 \wprint(re.findall('\w\w','Aah123 阅读全文
摘要:
生成器表达式res=[i for i in range(10) if i > 5]print(res)g=(i for i in range(10) if i > 5)print(g)print(next(g))print(next(g))print(next(g))print(next(g))pr 阅读全文
摘要:
强调:只有t模式下read(n),n代表字符个数,除此以外都是以字节为单位with open('a.txt',mode='rt',encoding='utf-8') as f: res=f.read(4) print(res)with open('a.txt',mode='rb') as f: re 阅读全文