briandconnelly / seeds

Stochastic Cellular Artificial Life Simulator
Other
20 stars 4 forks source link

Closing File Handles #73

Closed nahumj closed 12 years ago

nahumj commented 12 years ago

In many of the PrintActions a file is opened for writing, but never closed. This hasn't caused problems yet because when the python interpreter ends, it automatically closes open file handles. However, this is bad form and dangerous. If the PrintActions had some method that specified they were done (inverse of init), they could close their files.

briandconnelly commented 12 years ago

All actions have a teardown method that can be used for this. I agree with your point---even though python programmers typically don't do the close, which always bothered me---so I'll work to get those in the included plugins asap.