发布时间:2019-09-08 09:13:06编辑:auto阅读(3001)
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中,类属性为只读属性
54488
41274
35819
31348
26245
25948
24455
20032
16033
15464
2390°
2179°
2276°
2393°
2351°
2567°
2507°
2337°
2400°
2375°