An alternative Python interpreter.

Running code in the default Python interpreter is great as long as the code you write is short and you don’t make mistakes while typing the code in. After a couple of lines and multiple levels of indentation, using the interpreter becomes difficult. bpython is a good alternative to consider. bpython is a fancy interface … 

 

String Manipulation part 2: Regular Expressions

Regular Expressions in Python Regular Expressions (also known as REs, regexes or regex patterns) are a small and highly specialised programming language used to search for patterns in text strings. Regular Expressions allow you to specify patterns or rules that you want to match in a string. The patterns you define can be for matching: … 

 

String manipulation in Python.

Strings are one of the most fundamental data types. Strings in Python can be expressed in a number of ways. The most common way to create a new string is to enclose text in single or double quotes. Strings in Python are immutable, which means that they cannot be modified once they are created. That … 

 

Python command line interfaces: An overview of argparse.

Command-line or console applications are programs that are designed to be used via a text only interface such as the terminal. Command-line programs accept instructions or commands from their users in the form of flags or switches. Popular command-line applications include: git – A version control system Vim – A text editor and Grep – … 

 

Top 8 resources for Python beginners

Python is a popular, easy to learn programming language that is great option for beginners. There are a ton of good resources available online to get you started in learning Python programming. Because of this, It can be difficult for someone new to Python to know where to start or what books or courses to … 

 

An overview of the enumerate() function

According to the Python documentation, the enumerate function is a built in function that returns an enumerate object. Another popular article on the subject describes it as a function that allows you to “generate iterator element along with index”. I find these two definitions unclear. Here’s an explanation that makes more sense: the enumerate function … 

 

Exception handling in Python

Exception Handling There are at least two types of errors in the Python programming language: Syntax errors and Exceptions. Syntax Errors Syntax errors are sometimes referred to as parsing errors. These are fatal errors that occur when the code cannot be executed because of incorrect arguments passed to a function, typing or spelling error or … 

 

Getting started with SQLite in Python

Getting started with sqlite in Python SQLite is a lightweight disk-based relational database engine that does not require a separate server process. It allows you to access databases using the SQL language. A relational database is a collection of data organised and formally described in tables that consist of rows and columns. A simple analogy … 

 

PyCon Zimbabwe 2017

PyCon Zim 2017 I had the priviledge of attending PyCon Zimbabwe two weeks ago. This was my very first language conference. PyCon is a conference for the Python programming community. In Zimbabwe, it was held from the 23rd to the 26th of August 2017. This year’s PyCon was the second one in Zimbabwe and its …