import re p = re.compile("^[0-9]") m = p.match('13435aSAdb') print(m.group()) 一.上面的第二行和第三行也可以合并成一行来写 m = p.match("^[0-9]",'13435aSAdb') 效果是一样的,区别在于第一种方式是提前对要匹配的格式进行编译,第二种简写是每次匹配的时候都要进行一次匹配公式的编译,加入你需要从一个5w行的文件中匹配出所有以数字开头的行建议先把正则公式进行编译再匹…
python高级之多进程 本节内容 多进程概念 Process类 进程间通讯 进程同步 进程池 1.多进程概念 multiprocessing is a package that supports spawning processes using an API similar to the threading module. The multiprocessing package offers both local and remote concurrency,effectively side-…