Python Basics

This is a quick introduction to the basics of python programming language. It covers python3. Variables See the following program. Save as datatype.py: To run Output Casting between string, int,…

Object-Oriented Python

Python is a fully object-oriented programming language but it can also be used for scripting. It is assumed that you are already familiar with object-orientation concepts and have experience writing…

Python Error Handling

In Python, you can handle errors with exceptions. The following code will generate an FileNotFound error because the file it is trying to open does not exist: output An error…

Python Regular Expressions

Python uses re library for regular expressions. re comes with standard python installation. Regular expressions is a very big topic. This page only covers the basics of how to search…

Python Unit Testing Example

Unit testing functionality is built into Python3. Following is a very simple example: Save this file as mycode.py. Save the following code as mycode_unittest.py When you run the unit test…

Python File Management

This page shows how to work with text files using Python3 code. Following is a sample txt file we will be using. Lets called it stocks.txt Reading from File You…