Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
113 views
in Technique[技术] by (71.8m points)

Writing to the file is not accepted in Python


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I think you need to convert your Data response into a string to write it to a text file.

However, I can't really tell without seeing the error that you are getting, so if you post that I can see what is wrong.

As for best practices, you may also want to look into using the with open("Base.txt", "a") as students: syntax, as explained in the documentation: https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...