OCR GCSE (9-1) Computer Science Scratch Explanation …

read from a file and write back to it. ... >>> a_file = open('C:\\Python\NEA.txt') ... As I am on a Windows PC I define it as UTF-8. In this example we open a file called Ni.txt which doesn’t exist so Python creates is open opens it in the write mode and then adds a string and then closes it. ................
................