在UD功能中附加文件
我刚刚定义了一个函数来附加文本文件。似乎还可以,除了执行时,要键入文本,光标从“无”开始,问题以及如何删除“无”。但是,此“无”没有附加在txt文件中 这是我的代码
def file_apend(fa,x): fa.write(x) fa.close() fa = open('whd.txt','a')x = input(print('输入文本以附加文件........'....'))
)
file_apend(fa,x)
out the ut ...
输入文本以附加文件....... 没有我可以在这里附加...。
简而言之,如何删除此“无”
I just defined a function to append a text file. it seems to be OK, except, at time of execution to Typing Text the Cursor starts from 'None', what the problem and how to remove the 'None'. However, this 'None' is not appended in txt file
here is my code
def file_apend(fa,x):
fa.write(x)
fa.close()
fa = open('whd.txt','a') x=input(print('Enter Text to Append in File....... '))
file_apend(fa,x)
the OUT PUT is...
Enter Text to Append in File.......
None I can append here....
In Short HOW TO REMOVE THIS 'NONE'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我从另一个答案中得到了解决方案。这是我的解决方案:
我在单独的行中使用了
print()
。I got the solution from another answer. Here is my solution:
I used
print()
in a separate line.