发布时间:2019-09-08 09:13:06编辑:auto阅读(2524)
import sys
import re
PY_PATTERN = re.compile(
r"""
\s*\#(?:[^\r\n])*
| \s*__(?:[^\r\n]*)
| "{3}(?:\\.|[^\\])*"{3}
| '{3}(?:\\.|[^\\])*'{3}
""",
re.VERBOSE | re.MULTILINE | re.DOTALL
)
txt = open("cmd.txt").readlines()
b = re.sub(PY_PATTERN,'', ''.join(txt))
single = re.compile(r"\n\n")
b = re.sub(single,'\n',b)
print(b)
上一篇: python Class:获取对象类型
下一篇: python中,类属性为只读属性
51733
51399
41821
38593
33078
30083
28750
23747
23662
22028
46°
2255°
2945°
2456°
2398°
2991°
2409°
3211°
5283°
5109°