8 signs you’re doing Python right

If you’re following these eight great Python programming practices, then you’re doing Python right

8 signs you’re doing Python right
ComicSans / Getty

It’s often easy to tell when you’re doing development wrong. Bugs that pop out of nowhere, code that runs like molasses, and unwieldly project structures are just three of the tell-tale signs. But sometimes it’s not so easy to tell when you’re doing it right. Good programming habits are like the best special effects in the movies: You never notice they’re there, because they don’t announce themselves.

So what are some of the signs of good programming practice in Python? If you’re new to the language, and you could use some idea of what good Python development behavior looks like, or you’d just like to know if some of the habits you’ve picked up are worth keeping, we’ve collected a set of guideposts for you. If you’re following the eight best practices outlined below, then you’re doing Python right. 

You’re using virtual environments and project management tools

Even small, one-off Python projects benefit from a virtual environment and a proper project structure. Tools like Poetry make the setup process all but automatic. Even lowly venv makes it relatively straightforward to populate your project with a virtual environment and reap its benefits.

Version control is another vital project management tool. These days that typically means Git. And yes, you should take advantage of Git even for simple one-file projects. You never know when you’ll need to roll back to an earlier version of something. Most IDEs that support Python also have built-in support for venv and Git, so it’s easly to make use of them.

To continue reading this article register now

How to choose a low-code development platform