Python Forum
Newly written .txt file not printing - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Newly written .txt file not printing (/thread-5680.html)

Pages: 1 2


RE: Newly written .txt file not printing - buran - Oct-20-2017

(Oct-20-2017, 04:19 AM)Crackity Wrote: Both of the new print commands that I added in an attempt to print out the newly written lines before they were actually overwritten, were added after opening the file and before closing it again. If you look at the code again you should see that the same file is opened and closed 3 different times. So thank you for your reply but I don't think you understood my question. Smile
I understood your question perfectly fine. However it looks like you don't understand that traceback is meaningful only in relation to the actual code that produce it, not some hypothetical imaginary code that you don't bother to post. Among other useful things traceback shows the exact line at or around which is the error. Next time better post actual code that you run and that is producing the error.


RE: Newly written .txt file not printing - gruntfutuk - Oct-20-2017

Well done. Glad you got it working from a few clues.

Like a lot of programming, seems obvious once you get it.