Is this needed?
class Test:
def __init__(self, f):
self.f = open(f)
def __del__(self):
try:
self.f.close()
except:
pass
Also, how can i open a file, and have it in append mode. However, if the file doesn't exist, python creates it?