网络编程
位置:首页>> 网络编程>> Python编程>> Python将文本去空格并保存到txt文件中的实例

Python将文本去空格并保存到txt文件中的实例

作者:jhzhlc  发布时间:2021-06-14 05:01:42 

标签:Python,文本,空格,txt

如下所示:


#encoding=utf-8#

x=raw_input("Please enter a text: ")
y=x.replace(" ","")
f = open('Output.txt', 'w')
print >>f, y
f.close()

来源:https://blog.csdn.net/u012062310/article/details/52965636

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com