In this Python Programming Tutorial, we will be writing three different scripts to estimate how long it will take to reach certain goals. Our first script will calculate how many months it will take us to pay off a credit card. Our second script will calculate how many weeks it will take to lose a certain amount of weight. And our third script will estimate how long it will take to reach a certain number of subscribers. Let’s get started…

In this Python Programming Tutorial, we will be learning how to use context managers to properly manage resources. Context Managers are great for when we need to setup or teardown some resources during use. So these can be used for: open and closing files, opening and closing database connections, acquiring and releasing locks, and much much more. Let’s get started…

In this Python Programming Tutorial, we will be learning how to work with JSON data. We will learn how to load JSON into Python objects from strings and how to convert Python objects into JSON strings. We will also see how to load JSON from a file and save those Python objects back to files. Let’s get started…

In this Python Programming Tutorial, we will be learning how to scrape websites using the BeautifulSoup library. BeautifulSoup is an excellent tool for parsing HTML code and grabbing exactly the information you need. So whether you’re pulling down headlines from news sites, scores from sports websites, or prices from an online store… BeautifulSoup and Python will help you get this done quickly and easily. Let’s get started…

In this Python Programming Tutorial, we will be learning how to read, write, and match regular expressions with the re module. Regular expressions are extremely useful for matching common patterns of text such as email addresses, phone numbers, URLs, etc. Learning how to do this within Python will allow us to quickly parse files and text for the information we need. Let’s get started…

In this Python Programming Tutorial, I will be showing how I personally manage multiple projects, virtual environments, and environment variables. If you have ever worked on multiple projects, you probably know that it can be a hassle to keep all of your dependencies and project information separate. The strategy I have adopted over the years allows me to easily separate out my environments in such a way that they can be easily exported, activated, and also automatically activate the correct environment variables. Let’s get started…

In this Python Programming Tutorial, we will be learning how to generate random numbers and choose random data from lists using the random module. I personally use the random module pretty often in my tutorials to generate random data. This can also be used be games, simulations, and plenty of other useful tasks. Let’s get started…

In this Python Programming Tutorial, we will be learning how to unit-test our code using the unittest module. Unit testing will allow you to be more comfortable with refactoring and knowing whether or not your updates broke any of your existing code. Unit testing is a must on any large projects and is used by all major companies. Not only that, but it will greatly improve your personal code as well. Let’s get started.

In this Python Programming Tutorial, we will be learning how to work with csv files using the csv module. We will learn how to read, parse, and write to csv files. CSV stands for “Comma-Separated Values”. It is a common format for storing information. Knowing how to read, parse, and write this information to files will open the door to working with a lot of data throughout the world. Let’s get started.

In this Python Programming Tutorial, we’ll be learning how to parse a CSV file and output the data to an HTML unordered list. This is a real world problem I ran into with my website. The list was becoming too large for me to maintain manually, so writing a Python script to automate this process saved me a lot of time in the future. Let’s get started.