I can tell by your comments on the code, that it hasn't 'clicked' for you.
Still far from clicking, but slowly I'll get it :)
Please trust me
100% trust! I know that "with" is very powerful and I was using it to open a file, but from your code I learned that it can do much more, so yup, just from a few lines of yours thare's a lot of stuff which are very much worth exploring!
If something isn't clear, I am happy to help, but I can't also try to teach Python in my tutorials.
Your comments and posts are already way much more than what I was hoping to find :)
...and close it.
with
keeps any session (writing files, accessing databases, http sessions) open and closes it, too. This leads to cleaner structure and cleaner code.(The other way would be using
open()
andclose()
functions, which can lead to all sorts of trouble)btw did you manage to use condenser's get_accounts function?