New Python Tutorial: with

It is Python tutorial time again! I have titled this one after the star of the tutorial:

with

“That’s a pretty odd name for a tutorial. What is that even supposed to mean?”

Seasoned Python programmers will immediately know what I am talking about, but beginners should be scratching their heads right now. This tutorial talks about a better way to open files for reading and writing and why you should always use this method. I will not rehash the entire thing here. You will have to read it for yourself.

If you are wondering what the inspiration was for this tutorial, it was the first-hand view of two brand new programs that used the older method. Fortunately, I was able to advise these new programmers on this matter, but it showed me that the most popular beginner Python tutorials do not teach this method. In that light, I have written this tutorial to shed some light on this awesome feature of the Python programming language. 🙂
-le717

Advertisements