Python tutorials

Parse Datetime Strings with parsedatetime in Python

Introduction In this tutorial, we’ll take a look at how to parse Datetime with parsedatetime in Python. To use the parsedatetime package we first need to install it using pip: $ pip install parsedatetime Should pip install parsedatetime fail, the package is also opensource available on Github. Convert String to Python’s Datetime Object with parsedatetime The first, and most common way to use parsedatetime is to parse a string into a datetime object. First, you’ll want to import the parsedatetime […]

Read more

Python Community Interview With Dane Hillard

Today I’m joined by Dane Hillard, lead web application developer at ITHAKA and author of Practices of the Python Pro. Dane is also a Real Python tutorial author. In this interview, we discuss a variety of topics, including code complexity, Python package maintenance, and popcorn. So without further ado, let’s welcome Dane. Ricky: Thanks for joining me for this interview, Dane. I’d like to start in the same manner we do with all our guests: how did you get into programming, […]

Read more

Records and Sets: Selecting the Ideal Data Structure

There are a variety of ways for storing and managing data in your program and the choice of the right data structure has an effect on the readability of your code, ease of writing, and performance. Python has a wide selection of built-in mechanisms that meet most of your data structure needs. This course introduces you to two types of data structures: data records and sets. There are multiple types and classes for both of these data structures and this […]

Read more

Build an Asteroids Game With Python and Pygame

Do you want to create your own computer games but like Python too much to abandon it for a career as a game developer? There’s a solution for that! With the Pygame module, you can use your amazing Python skills to create games, from the basic to the very complex. Below, you’ll learn how to use Pygame by making a clone of the Asteroids game! In this tutorial, you’ll learn how to build a complete game, including: Loading images and […]

Read more

Matplotlib: Draw Vertical Lines on Plot

Introduction Matplotlib is one of the most widely used data visualization libraries in Python. Much of Matplotlib’s popularity comes from its customization options – you can tweak just about any element from its hierarchy of objects. In this tutorial, we’ll take a look at how to draw a vertical line on a Matplotlib plot, that allows us to mark and highlight certain regions of the plot, without zooming or changing the axis range. Creating a Plot Let’s first create a […]

Read more

Validating and Formatting Phone Numbers in Python with phonenumbers

Introduction Validating phone numbers can be a very challenging task. The format of a phone number can vary from one country to another. Heck, it can also vary within the same country! Some countries share the same country code, while some other countries use more than one country code. According to an example from the Google’s libphonenumber GitHub repository, USA, Canada, and Caribbean islands, all share the same country code (+1). On the other hand, it is possible to call […]

Read more

Python AI: How to Build a Neural Network & Make Predictions

If you’re just starting out in the artificial intelligence (AI) world, then Python is a great language to learn since most of the tools are built using it. Deep learning is a technique used to make predictions using data, and it heavily relies on neural networks. Today, you’ll learn how to build a neural network from scratch. In a production setting, you would use a deep learning framework like TensorFlow or PyTorch instead of building your own neural network. That […]

Read more

How to Convert DOCX To Html With Python Mammoth

Introduction At some point in your software development path, you’ll have to convert files from one format to another. DOCX (used by Microsoft Word) is a pretty common file format for a lot of people to use. And sometimes, we’d like to convert Word Documents into HTML. This can easily be achieved via the Mammoth package. It’s an easy, efficient, and fast library used to convert DOCX files to HTML. In this article, we’ll learn how to use Mammoth in […]

Read more

Python Community Interview With Ewa Jodlowska

Today I’m joined by Ewa Jodlowska, executive director of the Python Software Foundation (PSF), the organization devoted to advancing open source technology related to the Python programming language. In this interview, we discuss how Ewa started her tech journey, how COVID-19 affected the PSF, plans for PyCon US 2021, her love of hiking and lifting weights, and much more. Ricky: Thank you for joining me, Ewa. You’ve been at the PSF for over nine years at this point, first as […]

Read more
1 134 135 136 137 138 190