abjer / sds2019

Social Data Science 2019 - a summer school course
https://abjer.github.io/sds2019
46 stars 96 forks source link

Lecture 8 - Connector function use "with open"? #21

Open jrkkfst opened 4 years ago

jrkkfst commented 4 years ago

I haven't looked in detail at the Connector function, but noted that after running it myself once the file didn't close immediately. Ie. I couldn't view it (it perhaps hadn't flushed the cache?)

My question is, would it be useful to open the log file in the Connector function using "with open" to always close the file, when needed?

Perhaps this has been considered and isn't necessary?

Kristianuruplarsen commented 4 years ago

This is a good suggestion, i have begun implementing it in https://github.com/elben10/ScrapingClass/pull/1. If you want to contribute feel free.

elben10 commented 4 years ago

Thanks for the suggestion. It is now implemented.