Programming 

Python GUI Programming With Tkinter

Python has a lot of GUI frameworks, but Tkinter is the only framework that’s built into the Python standard library. Tkinter has several strengths. It’s cross-platform, so the same code works on Windows, macOS, and Linux. Visual elements are rendered using native operating system elements, so applications built with Tkinter look like they belong on the platform where they’re run. Although Tkinter is considered the de-facto Python GUI framework, it’s not without criticism. One notable criticism is that GUIs built with Tkinter look outdated. If you want a shiny, modern…

Read More

Python Community Interview With Kelly and Sean of Teaching Python

This week I’m joined by Kelly Paredes and Sean Tibor, the hosts of the Teaching Python podcast. Join us as we discuss the benefits of learning Python outside of the code itself, and what it’s like to learn Python when you’re not planning to become a professional developer. So, without further ado, let’s meet Kelly and Sean! Ricky: Welcome to Real Python, Kelly and Sean. I’m glad you could join me for this interview. Let’s start the same way we do with all our guests. How’d you get into programming,…

Read More
Programming 

Python Re Dot

You’re about to learn one of the most frequently used regex operators: the dot regex . in Python’s re library. What’s the Dot Regex in Python’s Re Library? The dot regex . matches all characters except the newline character. For example, the regular expression ‘…’ matches strings ‘hey’ and ‘tom’. But it does not match the string ‘yo\ntom’ which contains the newline character ‘\n’. Let’s study some basic examples to help you gain a deeper understanding. >>> import re >>> >>> text = ”’But then I saw no harm, and…

Read More
Programming 

Python Re ? Quantifier

Congratulations, you’re about to learn one of the most frequently used regex operators: the question mark quantifier A?. In particular, this article is all about the ? quantifier in Python’s re library. What’s the Python Re ? Quantifier When applied to regular expression A, Python’s A? quantifier matches either zero or one occurrences of A. The ? quantifier always applies only to the preceding regular expression. For example, the regular expression ‘hey?’ matches both strings ‘he’ and ‘hey’. But it does not match the empty string because the ? quantifier does…

Read More

Python Regex Sub

Do you want to replace all occurrences of a pattern in a string? You’re in the right place! This article is all about the re.sub(pattern, string) method of Python’s re library. Let’s answer the following question: How Does re.sub() Work in Python? The re.sub(pattern, repl, string, count=0, flags=0) method returns a new string where all occurrences of the pattern in the old string are replaced by repl. Here’s a minimal example: >>> import re >>> text = ‘C++ is the best language. C++ rocks!’ >>> re.sub(‘C\+\+’, ‘Python’, text) ‘Python is the…

Read More
Programming 

Using Pandas and Python to Explore Your Dataset

Do you have a large dataset that’s full of interesting insights, but you’re not sure where to start exploring it? Has your boss asked you to generate some statistics from it, but they’re not so easy to extract? These are precisely the use cases where Pandas and Python can help you! With these tools, you’ll be able to slice a large dataset down into manageable parts and glean insight from that information. In this tutorial, you’ll learn how to: Calculate metrics about your data Perform basic queries and aggregations Discover…

Read More
Programming 

Paolo Amoroso: A List of Free Python Books

If you’re like me, you love learning by reading books. So, when I set out to learn the Python programming language in the last days of 2018, I started looking for good books. I googled, browsed Reddit, checked major Python sites, and came out with a list Python books, including several free ebooks. I shared the list of free books to Reddit as I thought it may help others. Not only was the list a huge hit, some users suggested more great books. The GitHub repository of the list of…

Read More
Programming 

How to Check Your Python Version?

Simple Answer: To check your Python version, run python –version in your command line or shell. This general method works across all major operating systems (Windows, Linux, and macOS). Do you need to google important Python keywords again and again? Simply download this popular Python cheat sheet, print the high-resolution PDF, and pin it to your office wall: In the following video, I’ll show you how to check your Python version for each operating system (Windows, macOS, Linux, Ubuntu) and programming framework (Jupyter). Or scroll down to read the step-by-step…

Read More

Moshe Zadka: Meditations on the Zen of Python

(This is based on the series published in opensource.com as 9 articles: 1, 2, 3, 4, 5, 6, 7, 8, 9) Python contributor Tim Peters introduced us to the Zen of Python in 1999. Twenty years later, its 19 guiding principles continue to be relevant within the community. The Zen of Python is not "the rules of Python" or "guidelines of Python". It is full of contradiction and allusion. It is not intended to be followed: it is intended to be meditated upon. In this spirit, I offer this series…

Read More
Programming 

Python Data: Python Data Weekly Roundup – Dec 27 2019

In this week’s Python Data Weekly Roundup: Picks On AI Trends from Data Natives 2019 This article provides a good overview of the Data Natives 2019 – Europe meeting and the main trends being discussed for 2020 and beyond.  For example, topics such as “AI and its use in Healthcare” and “AI and Ethics” looked like good talks. Ray for the Curious An excellent review of “Ray”, a distributed computing system for python.  Ray is: is an open-source system for scaling Python applications from single machines to large clusters. Its…

Read More