python操作txt文件,去除文件中的隔行空行

conn = re.sub(result, '\r\n', content)
res = "".join(
  [s for s in conn.strip().splitlines(True) if s.strip()])
posted @ 2021-05-12 17:28  我在路上回头看  阅读(982)  评论(0编辑  收藏  举报