Wednesday, February 12, 2020

how to check garbage collector is enable or not

import gc
print(gc.isenabled())

output
True

example2:

import gc
print(gc.isenabled())
gc.disable()
print(gc.isenabled())

output:
True

False

No comments:

Post a Comment

python class topic video