GhostAatrox
总有一个理由,让自己开始变强

边界匹配

^  头

$  尾

\A  串头

\Z  串尾

 预定义字符集:

\d  [0-9] 数字

\D [^0-9]

\s 匹配任何空白字符

\S匹配任何非空白字符

\w【A-Za-z0-9】

\W【^A-Za-z0-9】

 下面记录一个xls存储:

import xlwt

book = Workbook(encoding='utf-8') 导入

Sheet = book.add_sheet('new sheet')#新建一张表单

Sheet.write(0,0,'name')

Sheet.write(0,1,'马云杰')

book.save('onetest.xls')#存取退出

下面记录一个txt存储:

with open('desktop/1.txt','w') as f :

f.write('hello world\n')

f.write('when you try,you will get better!')

f.close()

 

posted on 2018-04-03 15:25  GhostAatrox  阅读(107)  评论(0编辑  收藏  举报