Python

different chaped blocks with numbers

Python Numbers

Today we will discuss the different kinds of number variables in Python. How to interact with them, and what they are used for. There are four kinds of numbers in the python language: Int Long Float Complex Integers Integers are the basic kinds of numbers in any programming language. Integers are whole numbers, which means they do not have a decimal point. They can be either positive or negative. In Python 2 there is a maximum int size of 9223372036854775807. You can see this Read more […]


calendar shown on tablet

Working with DateTime objects in Python

When you read a date or time from a text file, user input, or a database, you are likely to get the date information as a string. It is helpful to convert the string to a datetime object since it will allow you to do more advanced functions. In todays article I will discuss and show examples of datetime objects in python. Specifically, I will show how to convert a string to a datetime, how to compare and reformat datetime variables, how to work with timezones, and how to extract specific bits of Read more […]


book with pages half open

Using TinyDB with Python

When writing your python code, you will undoubtedly find yourself in the situation where you need to store some structured data. You could just write the data to a file, but that data might take a bit of work to parse later on. Setting up a MySQL server takes a bit of work, and might be overkill for what you are trying to do. Today we will discuss how to use TinyDB in your python application to store structured data in JSON format.  And then easily retrieve that data without any fancy coding gymnastics What Read more […]


e=mc2 screenshot

Python Math Operators

Understanding the Python Math Operators is very important. You use these operators throughout the Python language whether it be concatenating strings, doing basic algebra, complex calculus, or delving into data science. In this article, we will cover the basics of doing math with python including how to do multiplication, division, addition subtraction, exponents, and orders of operation. What is an Operator? A math operator is a symbol that defines a specific kind of logic. For example, if Read more […]


lady tieing show ith pink laces

Python String Operations

A string is one of the many data types in Python. Some of the other common ones are objects, lists, integers, and dates. At its core, a string is really a list/array of characters. Today we will be Python String Operations. We will cover how to Concatenate, Tokenize, Manipulate, Search strings, and create string templates. Concatenate Concatenating strings is just taking two separate strings and gluing them together. In Python, it is extremely easy. You simply use the ‘+’ symbol to add the strings Read more […]


glass ball sitting on top of fence post

Python Virtual Environment

By default Python only gives you a single environment for your whole system.  This means when you install Python, or a package using Pip, you are installing that version of python or that version of the python package for the entire system.  And all scripts you run will interact with that same version of python or package. However, there are benefits to having a different python environment for each python application. Each application may have different dependencies. And may have compatibility Read more […]


Pandabear sitting on paper that says i love you

Python Pandas Tutorial

Pandas is useful for doing data analysis in Python. Today we will discuss how to install Pandas, some of the basic concepts of Pandas Dataframes, then some of the common Pandas use cases. What is Pandas? Pandas is a Python library for doing data analysis. Typically you will use it for working with 1-dimentional series data, or 2-dimentional data called data frames. This might include: Tabular data like SQL tables or Excel spreadsheets Ordered and unordered time series data. Matrix Read more […]


wooden table with flask, watch, camera, knife

Creating a webpage using Python and Flask

Did you know you can host a webpage using nothing but Python code? You don’t have to use things like IIS or Apache. While you may not get all of the same features. When you are trying to write a simple application. Or if you want to host an API, this route is an option for you. In this article, I will describe how to create a basic webpage using Python and Flask. Prerequisites To follow this tutorial, you need the following three prerequisites: install Python 3 Install Pip Install Read more […]


roap bridge through jungle

Error Handling in Python using With and Try

In this article we will discuss error handling using Python With Statements Try/Except/Finally statements, show how to use these in combination, and compare how it works to try/catch code blocks in other languages. What is error handling? Error handling is when you put in some extra code to tell your script what to do when things don’t go totally to plan. perhaps you try to open a file that isn’t there. Or perhaps a user puts in unexpected input. Without any error handling, your program Read more […]


colorful wordcloud

Creating word clouds with Python

Creating word clouds in Python is easy thanks to a few open source libraries. Today, we we’ll use the ammueler word cloud library and matplotlib to draw some word clouds. Word clouds are useful visualization tools for looking at the general theme of a document. As a document contains more instances of a given word, that word gets larger in the word cloud, and other words get smaller. Prerequisites Before we get started, you will need to install the prerequisites by running the following commands:

If Read more […]