摘要:
1、re.findall()函数语法:re.findall(pattern,string,flags=0) ——> list(列表)列出字符串中模式的所有匹配项,并作为一个列表返回。如果无匹配,则返回空列表!与re.search()不一样的地方:re.findall返回的是列表,re.search返回文本re.findall匹配多个值,re.search只要匹配到就返回,只匹配一个值>>> imp... 阅读全文
摘要:
文件操作过程一般为:打开、读写、关闭;打开:open()或file()读写:read()、write();关闭:close();1、打开:open()或file()file_handler=open(filename,,mode)使用file()打开文件或者使用open也行2、读写:read()、write()如下写:mode:r : 只读r+ : 读写w : 覆盖写,如果无则创建w+ : 覆盖读... 阅读全文