r/pythonhelp • • 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

2 comments sorted by

4

u/TJdutch Dec 23 '19

quick tip: it's good to use a context manager (like with) when working with files in Python

check 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

1

u/[deleted] Dec 23 '19

Thanks this is really helpful