发布时间:2019-09-08 09:13:06编辑:auto阅读(2449)
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中,类属性为只读属性
51345
50807
41400
38199
32691
29583
28416
23299
23257
21589
1665°
2399°
2006°
1941°
2273°
1972°
2677°
4476°
4306°
3069°