Signed up recently but had issues with the confirmation email?
Click Forgot password and follow the reset steps. You can choose the same password you used when you signed up. This should then provide access.
Remember to check Spam and Junk. The email will be from auth@progressbytes.co.uk.
301.15 File Handling Techniques
Practise exam questionsFile Handling Techniques — Note 4 of 4
Close file when done.
Files must be closed after use to ensure data is saved and system resources are freed. The with statement handles this automatically — it's the recommended approach.
with open() as f: closes automatically at end of blockwith, you must call f.close() manually# Manual close (avoid)
f = open("data.txt", "r")
data = f.read()
f.close()
# Better: with auto-closes
with open("data.txt", "r") as f:
data = f.read()
# File is already closed hereBack to File Handling Techniques
Specification notes for programming are in Paper 2.