I m trying to do a some activity on class obj destruction. How do I achive file open in _del__ function? (I m using Python 3.4)
class iam(object): def __in
As others have mentioned, don't use the ____del___ method to perform such cleanup. Instead, use either contextmanagers (with-statement) or register atexit-handlers.