2 Antworten
+ 1
file = open("/usercode/files/books.txt", "r")
rl = file.readlines()
for r in rl: print(r)
file.close()
https://www.sololearn.com/compiler-playground/co6jEhLuMsB5
0
I got this answer in same forum check if this is working.
You can create empty file :
f = open("myfile.txt", "x")
And also Create a new file if it does not exist:
f = open("myfile.txt", "w")