Can You Build Software With Python

Are you thinking of building a software application from scratch? Are you a developer with programming experience but new to Python? Are you looking to transition from working with other software languages to Python? If so, check out Can You Build Software With Python? This book will get you started building applications in Python within 24 hours. It has been designed for both professional and beginner developers who are new to Python.

Python as a programming language has gained a lot of traction over the past few years. But is it just hype, and can you actually build software with Python?

If you’re a developer, you’ve probably heard of the term “full stack developer”, someone who can build both the front end and back end of a web application. While this is certainly desirable, are we seeing too much emphasis on this in the programming community? Should we instead focus on hiring specialists who have perfected one skill rather than generalists who can do everything with mediocre results? In today’s post, I’ll argue that generalists are often better than specialists at software engineering and share some examples to illustrate my point. 

This article aims to guide you on Python website development from the ground-up. By the end of reading this article, you would make your first Python web application without writing much code.

Yes. You can build software with Python.

Python is a programming language that allows you to develop programs for a wide range of uses. In fact, it’s one of the most popular languages in the world, and it has been used by many companies to build their products. Many large organizations use Python as part of their product development process.

Python is a high-level programming language that is used to develop a wide range of software applications.

Python is an interpreted language, meaning that it can be run without first being compiled. It is also object-oriented, so it supports classes and other features that make it easy to use. Python has been around since 1991, but it has become increasingly popular in recent years.

Python has a large number of libraries available for use by developers who want to build different kinds of applications using the language. This means that there are many options available when you want to build software with Python!

Python is a general-purpose programming language that is used for web development and software development. Python is a popular language for beginner programmers because it’s easy to learn, but it also has advanced features that allow experienced programmers to create complex programs.

Python is free and open source, which means that anyone can use it for free (and even modify it if they want). The language runs on all major operating systems, including Windows, Linux, Mac OS X and more.

Python was created by Guido van Rossum in 1991. Since then, the language has evolved into many different versions of itself as well as several spin-off languages such as IronPython and Jython.

How to build your first Desktop Application in Python

Search the entire internet for uses of the Python programming language and they list them with Desktop Applications marked as not very suited with python. But years ago in 2016 when I was hoping to move on from web development to software development, Google.com told me I should choose python because it is used to build some modern and advanced scientific applications, then they mentioned blender3d. I knew blender3d, it is an awesome 3d creation software. love

A screenshot of blender3d (source: blender.org)

But its not their fault, the ugly things people are using as showcases for python GUIs are detestable, too old, and too expired looking windows, no young person would like that. I hope to change that notion with this simple desktop app tutorial. Lets get going.

We will be using PyQt (more on that soon) instead of Tkinter which was almost removed from the list of python standard libraries for being outdated.

What is PyQt (pronounced: pie-cute). It is one of the two ports of a framework, Qt (pronounced: cute) from C++, . That framework is known as the necessary framework for C++ developers. It is the framework behind blender3d, Tableau, Telegram, Anaconda Navigator, IPython, Jupyter Notebook, VirtualBox, VLC etc. We will use it instead of the embarrassing Tkinter.

The two ports of Qt are PySide and PyQt. They are both 99% alike. PyQt is the easiest of the two to install.

Prerequisites

  1. You should already know some python basics
  2. You should know how to install packages or libraries with pip
  3. You should already have python installed, of course.

Installation

The only thing we will need to install is PyQt. So open up your terminal, on windows it will be the Command Prompt or Powershell.

Type the command below into your terminal

>>> pip install PyQt6

PyQt6 because we are downloading the version 6 of PyQt. Wait for the installation to complete it will only take like a minute or two.

Project Files and Folders

Now that we are done with the installation. We should start with our project. Create a project folder for the app, we going to call it: helloApp. Create it anywhere you want on your computer, but its good to be organised.

Lets do a “Hello World”

Open up the main.py, preferably in vscode and enter the following code

main.py

import sys
import osfrom PyQt6.QtGui import QGuiApplication
from PyQt6.QtQml import QQmlApplicationEngine
from PyQt6.QtQuick import QQuickWindow
QQuickWindow.setSceneGraphBackend('software')app = QGuiApplication(sys.argv)engine = QQmlApplicationEngine()
engine.quit.connect(app.quit)
engine.load('./UI/main.qml')sys.exit(app.exec())

In the code above; we import sys, os, QGuiApplication and QQmlApplication modules.

The QQuickWindow.setSceneGraphBackend(‘software’) should be included in your code as a fallback option for uses with old hardware specs, other than that they would see an error information as seen below:

>>> Failed to create vertex shader: Error 0x80070057: The parameter is incorrect.
>>> Failed to build graphics pipeline state

Also the code calls QGuiApplication and QQmlApplicationEngine Which will use Qml instead of QtWidgets as the UI layer for the Qt Application. It then connects the UI layers quit function with the app’s main quit function. So both can close when the UI has been closed by the user. Next it loads the qml file as the qml code for the Qml UI. The app.exec() is what runs the Application, it is inside the sys.exit because it returns the exit code of the Application which gets passed into the sys.exit which exits the python sytem.

Add this code to the main.qml

main.qml

import QtQuick
import QtQuick.Controls.BasicApplicationWindow {
visible: true
width: 600
height: 500
title: "HelloApp" Text {
anchors.centerIn: parent
text: "Hello World"
font.pixelSize: 24
}}

The above code creates a Window, the visible code is very important, without that the UI is going to run but will be invisible,with width and height as specified, with a title of “HelloApp”. And a Text that is centered in the parent(which happens to be the window), the text displayed is “Hello World”, a pixel size of 24px.

In the previous Qt5, the import codes above would have included version numbers as

import QtQuick 2.15
import QtQuick.Controls 2.15

Also, in Qt6 we explicitly declare a style for the Controls as

import QtQuick.Controls.Basic

more about Controls styles later

If you have the above, you can run it and see your result.

Navigate into your helloApp folder

>>> cd helloApp

Now run it by doing:

>>> python main.py

If your code runs, you should see:

`An app window showing the text “Hello World”

Update UI

Now lets update a UI a little bit, lets add an image as a background and a text that will have a time

import QtQuick
import QtQuick.Controls.BasicApplicationWindow {
visible: true
width: 400
height: 600
title: "HelloApp" Rectangle {
anchors.fill: parent Image {
sourceSize.width: parent.width
sourceSize.height: parent.height
source: "./images/playas.jpg"
fillMode: Image.PreserveAspectCrop } Rectangle {
anchors.fill: parent
color: "transparent" Text {
text: "16:38:33"
font.pixelSize: 24
color: "white"
} } }
}

The above has an ApplicationWindow type, a Rectangle type inside it, that is actually filling up all the space of the window. There is an Image inside of it, and a another Rectangle that looks like its beside it, but because of the non-existence of a Layout type, its actually on top of the Image type. The Rectangle has a color of transparent since by default Rectangles are white, there is a Text inside of it that reads 16:38:33, to mock up time.

If you run the app the text will appear at the top-left corner of the Window. We do not like that, and so we are going to make it appear at the bottom-left corner with some margins instead.

In your qml code, update the Text type to include anchors as shown below:

            ...            Text {
anchors {
bottom: parent.bottom
bottomMargin: 12
left: parent.left
leftMargin: 12 }
text: "16:38:33"
font.pixelSize: 24
...
} ...

Now run it by doing

>>> python main.py

You should see something similar to this.

Now I would like the time to update

Use real time

Lets use a real time. Python provides us with native functions that give us all kinds of time and date related functions. We want a string with the current time. gmtime provides you with global time struct with all kinds of information and strftime constructs certains portions of the time as a string using the gmtime function

import the strftime, and gmtime functions

main.py

import sys
import os
from time import strftime, gmtimefrom PyQt6.QtGui import QGuiApplication
...

Then construct your time string below the imports, anywhere in the file

main.py

curr_time = strftime("%H:%M:%S", gmtime())

The %H, %M, %S, tells strftime, that we want to see Hours(24-hour type), minutes, and seconds. (Read more about format codes for strftime here). This variable will be passed on to the qml layer.

Lets create a property in qml that we can use to receive time string. This variable makes it easier to change the time. Lets call this property currTime

main.qml

...ApplicationWindow {
...
title: "HelloApp" property string currTime: "00:00:00"
...

Use this property in the qml, so when this value changes all the other places where it has been used also will change.

main.qml

...Text {
...
text: currTime // used to be; text: "16:38:33"
font.pixelSize: 48
color: "white"
}...

Now send our curr_time variable we created in python to qml by setting it to the currTime qml property.

main.py

...engine.load('./UI/main.qml')
engine.rootObjects()[0].setProperty('currTime', curr_time)...

The above code will set the qml property currTime to the value of the curr_time python property. This is one way we pass information from python to the UI layer.

Run the app and you should see no errors and will also have the current time. Hooray!!! Onward!!!

Update the time

To keep our time updated. We will need to use threads. Threading in python is easy and straightforward, we will use that instead of Qt’s threading. Thread uses functions or thread calls a function. I prefer we use a technique in Qt known as signals, this is a professional method, and studying it know will make your like better and easier. Lets put our current time code into a function, use underscore(_) for the file name. I will explain why later. It is not a requirement or anything, it is just good practice

To use signals we would have to subclass QObject, straightforward.

Create a subclass of QObject, call it whatever you like. I will call it Backend.

main.py

...
from PyQt6.QtQuick import QQuickWindow
from PyQt6.QtCore import QObject, pyqtSignal
class Backend(QObject): def __init__(self):
QObject.__init__(self)QQuickWindow.setSceneGraphBackend('software')...

The above code imports QObject and pyqtSignal, in pyside this is called Signal. It is one of the few differences between pyqt and pyside.

Formally, we had a property string that received our curr_time string from python, now we create a property QtObject to receive the Backend object from python. There are not that many types. Qml converts python base types into boolintdoublestringlistQtObject and varvar can handle every python type, but its the least loved.

main.qml

...
property string currTime: "00:00:00"
property QtObject backend
...

The above code creates a QtObject backend to hold our python object back_end. The names used are mine, feel free to change them to whatever you like

In the python pass it on

main.py

...
engine.load('./UI/main.qml')
back_end = Backend()
engine.rootObjects()[0].setProperty('backend', back_end)
...

In the above code an object back_end was created from the class Backend. We then set it to the qml property named backend

In Qml, one QtObject can receive numerous functions (called signals) from python that does numerous things, but they would have to be organised under that QtObject.

Create Connections type and target it to backend. Now inside the Connections type can be functions as numerous as we want to receive for the backend.

main.qml

...
Rectangle {
anchors.fill: parent Image {
...
}
...}Connections {
target: backend
}
...

Now thats’ how we connect with the python signals.

If we do not use threading our UI will freeze. Its quite emphatic to state that what we need here is threading and not multiprocessing.

Create two functions, one for the threading one for the actually function. Here is where the underscore comes in handy.

main.py

...
import threading
from time import sleep
...
class Backend(QObject):
def __init__(self):
QObject.__init__(self) def bootUp(self):
t_thread = threading.Thread(target=self._bootUp)
t_thread.daemon = True
t_thread.start() def _bootUp(self):
while True:
curr_time = strftime("%H:%M:%S", gmtime())
print(curr_time)
sleep(1)...

The above code has an underscore function that does the work creating an updated time.

Create a pyqtsignal called updated and call it from a function called updater

main.py

...
from PyQt6.QtCore import QObject, pyqtSignal... def __init__(self):
QObject.__init__(self) updated = pyqtSignal(str, arguments=['updater']) def updater(self, curr_time):
self.updated.emit(curr_time) ...

In the above code the pyqtSignal, updated, has as it arguments parameter the list containing the name of the function ‘updater’. From this updater function, qml shall receive data. In the updater function we call(emit) the signal updated and pass data (curr_time) to it

Update the qml, receive the signal by creating a signal handler, a signal handlers name is the capitalised form of the signal name preceded by ‘on’. So, ‘mySignal’ becomes ‘onMySignal’ and ‘mysignal’ becomes ‘onMysignal’.

main.qml

...
target: backend function onUpdated(msg) {
currTime = msg;
}
...

In the above code you can see the signal handler for updated signal is called onUpdated. It is also has the curr_time passed to it as msg.

All is well but we are yet to call the updater function. Having a seperate function to call the signal is not necessary for a small application as this. But in a big application, it is the recommended way to do it. Change the delay seconds to 1/10 of a second. I have found this figure to the best to update time.

main.py

            ...
curr_time = strftime("%H:%M:%S", gmtime())
self.updater(curr_time)
sleep(0.1)
...

The bootUp function should be called immediately after the UI has loaded.

...
engine.rootObjects()[0].setProperty('backend', back_end)back_end.bootUp()sys.exit(app.exec())

All is done!!!

Run the code:

>>> python main.py
Your seconds should be updating now

Bonus:

Make the Window Frameless

You can make the window frameless and stick it to the bottom right of the Screen.

main.qml

...
height: 600
x: screen.desktopAvailableWidth - width - 12
y: screen.desktopAvailableHeight - height - 48
title: "HelloApp"flags: Qt.FramelessWindowHint | Qt.Window...

The above code sets xy for the window and add flags, to make the window frameless. The Qt.Window flag ensures that even though the window is frameless, we still get a Taskbutton

Run it, and you should be glad with what you see.

>>> python main.py

At long last, the coding has ended and here are the final codes.

main.py

import sys
import os
from time import strftime, gmtime
import threading
from time import sleepfrom PyQt6.QtGui import QGuiApplication
from PyQt6.QtQml import QQmlApplicationEngine
from PyQt6.QtQuick import QQuickWindow
from PyQt6.QtCore import QObject, pyqtSignal
class Backend(QObject):
def __init__(self):
QObject.__init__(self) updated = pyqtSignal(str, arguments=['updater']) def updater(self, curr_time):
self.updated.emit(curr_time) def bootUp(self):
t_thread = threading.Thread(target=self._bootUp)
t_thread.daemon = True
t_thread.start() def _bootUp(self):
while True:
curr_time = strftime("%H:%M:%S", gmtime())
self.updater(curr_time)
sleep(0.1)
QQuickWindow.setSceneGraphBackend('software')app = QGuiApplication(sys.argv)
engine = QQmlApplicationEngine()
engine.quit.connect(app.quit)
engine.load('./UI/main.qml')back_end = Backend()engine.rootObjects()[0].setProperty('backend', back_end)back_end.bootUp()sys.exit(app.exec())

main.qml

import QtQuick
import QtQuick.Controls.BasicApplicationWindow {
visible: true
width: 360
height: 600
x: screen.desktopAvailableWidth - width - 12
y: screen.desktopAvailableHeight - height - 48
title: "HelloApp" flags: Qt.FramelessWindowHint | Qt.Window property string currTime: "00:00:00"
property QtObject backend Rectangle {
anchors.fill: parent Image {
sourceSize.width: parent.width
sourceSize.height: parent.height
source: "./images/playas.jpg"
fillMode: Image.PreserveAspectFit
} Text {
anchors {
bottom: parent.bottom
bottomMargin: 12
left: parent.left
leftMargin: 12
}
text: currTime
font.pixelSize: 48
color: "white"
} }
Connections {
target: backend function onUpdated(msg) {
currTime = msg;
}
}}

Apart from the names that you may have changed, everything should be similar.

Build and next steps

Building a pyqt application could be the easiest, since it is widely known.

To build, install pyinstaller, since building is a part of the bonus section, we didn’t install it before.

>>> pip install pyinstaller

We could have easily done run the following code in the applications folder (helloApp) but, we have to take care of the resources that we used.

>>> pyinstaller main.py

Instead, first do:

>>> pyi-makespec main.py

It generates a spec file for you to update first, then you can run pyinstaller again

The datas parameter can be used to include data files in your App or App’s folder. Its a list of tuples, and the tuple always has two items, the target path, we will be including, and the destination path, where it should be stored in the Application’s folder. The destination path must be relative. If you want it placed right there with the app’s executables, you make it an empty string (‘’), if you want it to be in a nested folder within the application’s folder, you specify the nested folder (‘nest/nested/really_nested’)

Update the datas parameter like you see below to match the path to your helloApp’s UI folder on your computer.

Set the console parameter to False, since this is a Gui and we are not testing it.

main.spec

...
a = Analysis(['main.py'],
...
datas=[('I:/path/to/helloApp/UI', 'UI')],
hiddenimports=[],
...
exe = EXE(pyz,
a.scripts,
[],
...
name='main',
debug=False,
...
console=False )
coll = COLLECT(exe,
...
upx_exclude=[],
name='main')

The name parameter in the EXE call is the name of the executable itself. eg. main.exe, or main.dmg but the name parameter in the COLLECT call is for the folder name in which the executable and all its accompanying files will be stored, both can be changed. But the names were based on the file we used to generate the spec, remember: ‘main.py’

Finally, build your application using

>>> pyinstaller main.spec

Now you should see a folder named ‘dist’ with another folder within it named ‘main’ with the application files. Search for the main.exe, or main executable and run it. TADAAA! And all is well.

Next Steps

Apart from the way that the UI folder was included and used in the application, all of the things we’ve talked about are used in production. Resources are bundle before being deployed in production.

But the Signals, how the background image was used, to the frameless window are all techniques used in production and so to speak, in real-world. Its just that there is more to it. Yes there is more to frameless Windows, you have to handle the titlebar, the resizing and dragging of the window among other things if you are not going to use it as a splash screen, not that complex, but it goes beyond the scope of this tutorial.

Qml is a lot more than Images, Rectangles and Text, and the Layout system are four types. They are easy to study, but practical approach is the best, so I have not bothered to explain them.

Continue with PyQt and Qml, it will lead into a career in software development, embedded systems, and in the future Data visualization. Prefer it over TKinter, its popularity keeps increasing by the day.

Python in the Real World

Python is a high-level and general-purpose programming language. As this definition implies, you can use Python for several purposes, from web development to data science, machine learning, and robotics. Python’s real-world use cases are limitless.

You’re probably wondering what people are successfully building with Python. If you take a quick look at companies using the language, then you’ll find world-class companies, such as Google, YouTube, Facebook, Instagram, Spotify, Netflix, and more.

Google has used Python from the start, and it’s gained a place as one of the tech giant’s main server-side languages. Guido van Rossum, Python’s creator, worked there for several years, overseeing the language’s development.

Instagram likes Python for its simplicity. The service is known for running “the world’s largest deployment of the Django web framework, which is written entirely in Python.”

Spotify uses the language for data analysis and back-end services. According to its team, Python’s ease of use leads to a lightning-fast development pipeline. Spotify performs a ton of analysis to give recommendations to its users, so it needs a productive tool that works well. Python to the rescue!

You’ll also find that Python has been vital for science and space exploration, with a lot of exciting use cases in robotics and hardware control.

In this article, you’ll see how you can use your Python skills in a wide range of areas.

Develop Cool Software

Python’s ecosystem provides a rich set of frameworks, tools, and libraries that allow you to write almost any kind of application. You can use Python to build applications for the Web as well as desktop and mobile platforms. You can even use Python to create video games.

Web Development

Developing web applications with Python is one of the most in-demand skills, with a lot of opportunities for you out there. In this field, you’ll find several useful Python frameworks, libraries, and tools for developing cool web applications, APIs, and more. Here are some of the most popular Python web frameworks:

FrameworkDescription
DjangoDjango is a high-level framework that encourages rapid web application development with a clean and pragmatic design. It allows you to focus on writing your applications without having to reinvent the wheel.
FastAPIFastAPI is a fast and performant web framework for building web APIs. It’s built on top of modern Python type hint features and enables asynchronous programming.
FlaskFlask is a lightweight framework for creating WSGI web applications. It allows you to get started quickly and to scale up to complex applications if needed.
TornadoTornado is a web framework and asynchronous networking library. It uses non-blocking network I/O, so you can write applications that can scale to tens of thousands of open connections.

To get started with web development, check out:

  • Python Web Development Tutorials
  • Django Tutorials
  • Flask Tutorials
  • FastAPI Tutorial

If you want some practical project ideas for applying your web development skills right away, then you can build a portfolio web application with Django. With so many jobs and career opportunities out there, it’s a great idea to have a personal portfolio these days, so go ahead and give it a try. You don’t need to know anything about Django to get started with this step-by-step tutorial. It’s perfect if you’re itching to get your hands dirty with web development in Python.

CLI Development

Another field in which Python shines is command-line interface (CLI) application development. CLI applications are everywhere and allow you to automate repetitive and boring tasks in your day-to-day work by creating small and large tools for your command line.

In Python, you have an impressive set of CLI libraries and frameworks that can make your life more pleasant and help you build command-line tools quickly:

LibraryDescription
argparseargprse is a standard library module that allows you to write user-friendly command-line interfaces. You can define the arguments you want to take at the command line and parse them nicely. It automatically generates help and usage messages and issues errors when your users provide invalid input.
ClickClick is a Python package for creating beautiful command-line interfaces with as little code as needed. It’s highly configurable and comes with sensible defaults out of the box. Its goals include making the process of writing command-line tools quick and fun.
TyperTyper is a library for building CLI applications that users will love using and developers will love creating. It provides automatic help messages and automatic completion for all shells. It minimizes code duplication and facilitates debugging.

To get started with CLI development, check out:

  • How to Build Command Line Interfaces in Python With argparse
  • Comparing Python Command-Line Parsing Libraries – Argparse, Docopt, and Click

Additionally, if you want to jump into building a CLI application project, then you can start by creating a directory tree generator tool for your command line. In this step-by-step project, you’ll build a command-line tool for generating ASCII diagrams that display the contents of a directory or folder in your file system.

Creating applications with a user-friendly and intuitive command-line interface is a valuable skill for any Python developer.

GUI Development

Creating traditional graphical user interface (GUI) applications for desktop environments is also an attractive option in Python. If you’re interested in building this kind of application, then Python has you covered with a wide range of GUI libraries, frameworks, and toolkits to choose from:

LibraryDescription
KivyKivy is a library for rapid development of applications with innovative user interfaces, such as multi-touch applications. It runs on Linux, Windows, macOS, Android, iOS, and Raspberry Pi.
PyQtPyQt is a set of Python bindings for the Qt application framework. It includes classes for building GUI applications. It also provides classes for networking, threads, SQL databases, and more. It supports the Windows, Linux, and macOS platforms.
PySimpleGUIPySimpleGUI is a library that aims to transform the tkinter, Qt, wxPython, and Remi GUI frameworks into a simpler interface. It uses Python core data types to define windows and simplify event handling.
Qt for Python (PySide6)Qt for Python is a project that provides the official set of Python bindings (PySide6) for the Qt framework.
tkintertkinter is a standard Python interface to the Tk GUI toolkit. It allows you to build GUI applications without the need for third-party dependencies. It’s available on most Unix platforms as well as on Windows systems.
wxPythonwxPython is a Python binding for the wxWidgets C++ library. It allows you to create applications for Windows, macOS, and Linux with a single code base. It gives applications a native look and feel because it uses the platform’s native API.

A quick way to start building your GUI applications is to use tkinter. This module comes in the Python standard library. Practice using tkinter and watch your vision materialize on the screen. Once you’ve got your feet wet, you can branch out and start working with other Python GUI toolkits.

To get started with GUI programming, check out:

  • Python GUI Programming Tutorials
  • Python GUI Programming Learning Path
  • GUI Programming With PyQt Learning Path

Building back-end services is an essential part of development. However, you also need a front end. Creating applications that users can effectively interact with is paramount.

If you want to start creating real-world GUI applications, then you can build a calculator using PyQt. Completing this calculator project will help you grasp the fundamentals of this full-featured GUI framework, so you can start building nice things for your desktop immediately.

You can also find some other practical projects to help you out with your GUI programming journey. Take a look at the following resources:

  • Build a Bulk File Rename Tool With Python and PyQt
  • Build a Contact Book With Python, PyQt, and SQLite

These projects will guide you through the process of building GUI applications with PyQt and Python. They will also help you integrate a wide variety of skills to create fully functional real-world applications.

Game Development

Creating computer games is a great way to learn how to program not only in Python but also in any other language. To develop games, you’ll need to use variables, loops, conditional statements, functions, object-oriented programming, and more. Game development is an excellent option to integrate multiple skills.

Computer games have played an important role in programming. Many people get into programming because they love games and want to re-create their favorite games or build their own. Developing computer games can be a fun and rewarding adventure, in which you can live the great experience of playing the game you just created.

You’ll find several tools, libraries, and frameworks for creating games quickly in the Python ecosystem. Here’s a small sample of them:

LibraryDescription
ArcadeArcade is a Python library for creating 2D video games. It’s ideal for people learning to program because they don’t need to learn a complex game framework to start creating their own games.
PyGamePyGame is a set of Python modules designed for writing video games. It adds functionality on top of the SDL library. It allows you to create full-featured games and multimedia programs. The library is highly portable and runs on several platforms and operating systems.
pygletpyglet is a powerful Python library for creating games and other visually rich applications on Windows, macOS, and Linux. It supports windowing, user interface event handling, OpenGL graphics, loading images, and playing videos and music.

To get started with game programming, check out:

  • Python Game Development Tutorials
  • PyGame: A Primer on Game Programming in Python

You can use Python to create arcade games, adventure games, and puzzle games that you can deploy within a few hours. You can also code classic games, such as hangman, tic-tac-toe, rock paper scissors, and more with your newly acquired programming skills.

If you want to dive into building your first game, then you can start by building an Asteroids game with Python and PyGame. If you want to go a step further and build your first platform game, then check out Build a Platform Game in Python With Arcade.

Dive Into Data Science and Math

Data science is a field that involves cleaning, preparing, and analyzing data to extract knowledge from it. Data science combines statistics, mathematics, programming, and problem-solving skills to extract useful information from data.

Python plays a fundamental role in the fields of data science and math. The language has become popular among scientists because of its readability, productivity, flexibility, and portability. The Python ecosystem around science has grown immensely. You’ll find mature Python solutions in almost every major field in math and science.

Python includes tools for machine learning (ML), artificial intelligence (AI), scientific computing, data analysis, and data visualization. The language also provides efficient tools for collecting, mining, and manipulating data.

Machine Learning

Machine learning can be the first step for someone interested in artificial intelligence. Machine learning studies algorithms that learn through experience. These algorithms build models based on samples of training data to make predictions and decisions.

Machine learning can be an intimidating field to get started with because the space is fast and ever-changing. Here’s a summary of some of the most popular tools for doing machine learning with Python:

LibraryDescription
KerasKeras is an industrial-strength deep learning framework with an API designed for human beings. It allows you to run new experiments and try more ideas quickly. It follows best practices for reducing cognitive load.
NLTKNLTK is a platform for building Python programs to work with human language data. It provides libraries for classification, tokenization, stemming, tagging, parsing, and semantic reasoning.
PyTorchPyTorch is an open source machine learning framework that accelerates the path from research prototyping to production deployment.
scikit-learnscikit-learn is an open source machine learning library that supports supervised and unsupervised learning. It’s an efficient tool for predictive data analysis that’s accessible to everybody and reusable in various contexts.
TensorFlowTensorFlow is an end-to-end open source platform for machine learning. It has a comprehensive, flexible ecosystem of tools, libraries, and community resources that will help you build and deploy ML-powered applications.

To get started with machine learning, check out:

  • Python Machine Learning Tutorials
  • Machine Learning With Python Learning Path

Scientific Computing

Another field in which Python plays a significant role is scientific computing. Scientists use advanced computing capabilities available through supercomputers, clusters of computers, and even desktop and laptop computers to understand and solve complex problems.

Here are some of the libraries and tools you can use for scientific computing in Python these days:

LibraryDescription
NumPyNumPy is a fundamental package for scientific computing with Python. It offers comprehensive mathematical functions, random number generators, linear algebra routines, Fourier transforms, and more. It provides a high-level syntax that makes it accessible and productive.
SciPySciPy is a Python-based collection of open source software for mathematics, science, and engineering.
SimPySimPy is a process-based discrete-event simulation framework based on Python. It can help you simulate real-world systems, such as airports, customer services, highways, and more.

To get started with scientific computing, check out:

  • Math for Data Science Learning Path
  • NumPy, SciPy, and Pandas: Correlation With Python
  • SimPy: Simulating Real-World Processes With Python

The libraries and tools in this section are fundamental pieces in the data science space in Python. Some of them are core components of higher-level libraries for machine learning, data analysis, and more.

Data Analysis and Visualization

Data analysis is a process of collecting, inspecting, cleansing, transforming, and modeling data to discover useful information, make predictions, arrive at conclusions, support decision-making processes, and more. Data analysis is closely related to data visualization, which deals with the graphical representation of data.

In Python, you’ll also find mature and well-established libraries for data analysis and data visualization. Here are some of them:

LibraryDescription
BokehBokeh is an interactive data visualization library for web browsers. It provides tools for constructing elegant and versatile graphics. It can help you quickly make interactive plots, dashboards, and data applications.
DashDash is a Python framework for building web analytic applications quickly. It’s ideal for building data visualization applications with custom user interfaces that render in the browser.
MatplotlibMatplotlib is a library for creating static, animated, and interactive data visualizations in Python.
pandaspandas is a powerful and flexible open source tool for analyzing and manipulating data. It provides fast, flexible, and expressive data structures to work with relational or labeled data.
SeabornSeaborn is a Python data visualization library based on Matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics that allow you to explore and understand your data. It integrates closely with pandas data structures.

To get started with data analysis and visualization, check out:

  • Data Collection & Storage Learning Path
  • Data Visualization With Python Learning Path
  • Data Science With Python Core Skills Learning Path
  • Pandas for Data Science Learning Path Learning Path
  • Develop Data Visualization Interfaces in Python With Dash

If you want to level up your data analysis skills by building a practical project, then you can create a gradebook with Python and pandas. This step-by-step project guides you through the process of creating a Python script that loads the grade data and calculates letter grades for a group of students. The project involves loading the data from a comma-separated values (CSV) file, exploring the data, and calculating and plotting the grades using pandas.

Web Scraping

One of the most significant sources of information for doing data science is the Web. The process of collecting and parsing raw data from the Web with an automated tool (crawler) is known as web scraping.

Python has a great set of tools and libraries for scraping data from the Web. Here are some of them:

LibraryDescription
Beautiful SoupBeautiful Soup is a Python library for pulling data out of HTML and XML files into parse trees. The library provides methods and Pythonic idioms to navigate, search, modify, and extract information from parse trees.
requestsrequests is an elegant and powerful HTTP library for Python. It provides an intuitive and concise API designed for human beings.
ScrapyScrapy is a fast, high-level web crawling and web scraping framework. It allows you to crawl websites and extract structured data from their pages.
urllib.requesturllib.request is a standard library module that defines functions and classes to help you open URLs. It also allows you to work with basic and digest authentication, redirections, cookies, and more.

To scrape data from the web, check out:

  • Python Web Scraping Tutorials
  • Python Web Scraping Learning Path

Once you know the basics of web scraping, you can dive into a practical project and build your own web scraper with Python and Beautiful Soup. After finishing this practical project, you’ll be able to apply the same process and tools to any other static websites out there. These skills allow you to extract relevant information and use it in your applications. Go ahead and give it a try!

Note: Before using your Python skills for web scraping, you should check the use policy of your target website to make sure that scraping it with automated tools isn’t a violation of its terms of use.

A second project you can build right away is a Bitcoin price notification service. Since topping out at a price of just over $40,000 in January 2021, the cryptocurrency has been on the minds of millions. Its price continues to fluctuate, but many people out there would consider it a worthwhile investment.

If you’re looking to cash in on the virtual gold rush and just need to know when to make your move, then you’ll need to stay on top of Bitcoin’s prices. The foundation of this project is the creation of IFTTT (If This Then That) applets. You’ll learn how to use requests to send HTTP requests and how to use a webhook to connect your application to external services.

This Bitcoin price notification service is the perfect starter project for a beginner Pythonista with interest in crypto. Then you can extend the service you’ll build in this tutorial to monitor other currencies as well.

Thanks to the Internet—and, increasingly, the Internet of Things—you now have access to hordes of data that weren’t available years ago.

Analytics is a huge part of any field that works with data. What are people talking about? What patterns can you see in their behavior? Twitter is a great place to get answers to some of these questions. If you’re interested in data analysis, then a Twitter sentiment analysis project is a great way to use your Python skills to answer questions about the world around you.

In this project, you’ll learn how to mine Twitter data and analyze user sentiment with a Docker environment. You’ll learn how to register an application with Twitter, which you’ll need to do in order to access their streaming API. You’ll see how to use Tweepy to filter which tweets you want to pull, TextBlob to calculate the sentiment of those tweets, Elasticsearch to analyze their content, and Kibana to visualize the results.

Conclusion

This course isn’t for the complete beginner (i.e. someone who’s never written a line of code before) because a lot of these concepts are not introduced in detail on this website—you’ll have to do your own research for some things. I already knew all these basics, but the resources made it easy for me to learn more about each topic. After watching a few dozen videos, and reading many of their articles, I feel very confident in recommending this site to anyone looking to get started building software with Python!

Leave a Comment