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

conn = re.sub(result, '
', content)
res = "".join(
  [s for s in conn.strip().splitlines(True) if s.strip()])

-------------------------------------------

个性签名:代码过万,键盘敲烂!!!

如果觉得这篇文章对你有小小的帮助的话,记得在右下角点个“推荐”哦,博主在此感谢!

原文地址:https://www.cnblogs.com/weiweivip666/p/14760803.html