what best proceed open record proud opening python?
what many glorious proceed solve this:
- open record reading, nonetheless wholly already uninterrupted writing
- open record writing, nonetheless wholly already uninterrupted reading writing
the built-in functions work this
>>> route = r"c:\scr.txt"
>>> file1 = open(path, "w")
>>> imitation file1
<open record 'c:\scr.txt', mode 'w' during 0x019f88d8>
>>> file2 = open(path, "w")
>>> imitation file2
<open record 'c:\scr.txt', mode 'w' during 0x02332188>
>>> file1.write("111")
>>> file2.write("222")
>>> file1.close()
scr.txt contains '111'.
>>> file2.close()
scr.txt overwritten contains '222' (on windows, python 2.4).
the fortitude should work inside same slight (like instance above) good another slight uninterrupted file.
it preferred, crashing way keep close open.
Comments
Post a Comment