怎么样:
text = os.linesep.join([s for s in text.splitlines() if s])
text
上一篇 将CSV文件转换为词典列表
下一篇 在PyQt中使用Windows 7任务栏功能
版权所有 (c)2021-2022 MSHXW.COM
ICP备案号:晋ICP备2021003244-6号