r/pythonhelp • u/[deleted] • Dec 23 '19
I need help with writing input into a txt file.
I have I = open(“f.txt”, “w”) I.readable I.readline I.close
4
Upvotes
r/pythonhelp • u/[deleted] • Dec 23 '19
I have I = open(“f.txt”, “w”) I.readable I.readline I.close
4
u/TJdutch Dec 23 '19
quick tip: it's good to use a context manager (like
with) when working with files in Pythoncheck https://realpython.com/read-write-files-python/ for some more info pertaining file ops and go find yourself some understandable docs to learn a thing or two. Lots of people like https://automatetheboringstuff.com so give it a try