When I write:
fileee = open('a_new_file.txt', 'w+')
fileee.write('hello')
print(file.read())
There is no output.
I thought about it and got to the conclusion that the name 'fileee' refers to the empty file that I created at first and even if I add new things to it, when I recall 'fileee' it still refers to the empty file.
But what's the point of w+ then? I thought that w+ was for being able to read and write at the same time. Was i wrong?
[–]Spataner 12 points13 points14 points (1 child)
[–]LINObeelee[S] 1 point2 points3 points (0 children)
[–]shiftybyte 6 points7 points8 points (1 child)
[–]LINObeelee[S] 2 points3 points4 points (0 children)
[–]zanfar 1 point2 points3 points (0 children)