12/6 without ".close()", ".write()" is working


#1

In this exercise
File I/O, topic 6

.write(...)

is still worked, but the thing is, that there's no

.close()

method for this.
But file text.txt get new data - "Not closing files is VERY BAD."


There is an error or what?
Because in theory, buffer is flashed, if you don't close the opened session with file.
Quote:

If you write to a file without closing, the data won't make it to the target file.


You need to close opened file for writing data to it.



#2

If I understand correctly, it's possible that Codecademy is teaching something not entirely true when really programming. In the real world it is true, if you write to a file and don't close it, the data will (usually) be lost. The learning done on Codecademy is theoretical, generally, so there are sometimes these problems.

That is assuming I understood your comment.


#3

Yes, you did.
I know this without comments about it.
I'm only want to tell developers about this stuff.

But thank you anyway.

3 августа 2016, 20:33:37, от "825orion" < codecademy@discoursemail.com >:

825orion
August 3 If I understand correctly, it's possible that Codecademy is teaching something not entirely true when really programming. In the real world it is true, if you write to a file and don't close it, the data will (usually) be lost. The learning done on Codecademy is theoretical, generally, so there are sometimes these problems. That is assuming I understood your comment. Visit Topic or reply to this email to respond. To unsubscribe from these emails, click here .


#4

Understood. Thanks for posting.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.