Category: Python

How to Fix Python Pip Install Error in Ubuntu 24.04

When using pip command to install a Python package in Ubuntu 24.04 will output “error: externally-managed-environment“. Here are a few workarounds to ‘fix’ the issue.

Source: How to Fix Python Pip Install Error in Ubuntu 24.04 | UbuntuHandbook

How to Use Python Regular Expression with RE Library

Welcome to our today’s guide related to Python regex. In this guide, we will discuss what are regular expressions in Python and how to use the “re” module.

Moreover, we will also explore advanced techniques, such as optimization techniques of the regular expression, lookahead assertions, and how regex can be utilized to improve data validation, streamline text parsing, and perform web scraping.

Source: How to Use Python Regular Expression with RE Library (GeeksVeda)

Shell Genie – a command-line tool that lets you interact with the terminal in plain English

Shell Genie

Your wishes are my commands.

Shell Genie is a command-line tool that lets you interact with the terminal in plain English. You ask the genie what you want to do and it will give you the command you need.

System must have Python 3.10 or higher installed.

Shell Genie – Your wishes are my commands (GitHub)

Videos show how to use Shell Genie:

An article on Shell Genie:

Convert Plain English To Commands Using GPT-3 Powered Shell Genie (Linux Uprising)

Python namedtuple (Take the tuple to the next level)

In this tutorial, you’ll learn how to create a Python namedtuple from a list or a tuple, how to get namedtuple items or specific item, how to sort it, and more.

Source: Python namedtuple (Take the tuple to the next level) – Like Geeks

How To Use Assignment Expressions in Python

Python 3.8, released in October 2019, adds assignment expressions to Python via the := syntax. The assignment expression syntax is also sometimes called “the walrus operator” because := vaguely resembles a walrus with tusks.

Assignment expressions allow variable assignments to occur inside of larger expressions. While assignment expressions are never strictly necessary to write correct Python code, they can help make existing Python code more concise. ….. In this tutorial, you will use assignment expressions in several examples to produce concise sections of code.

Source: How To Use Assignment Expressions in Python | DigitalOcean

PySimpleGUI: Super-simple GUI to grasp… Powerfully customizable (Python)

Looking to take your Python code from the world of command lines and into the convenience of a GUI? Have a Raspberry Pi with a touchscreen that’s going to waste because you don’t have the time to learn a GUI SDK? Look no further, you’ve found your GUI package.

Source: PySimpleGUI (Github)

Note: Scroll down the page for instructions and sample usage. This really does seem like an easy way for Python users to add GUI interfaces to their Python scripts. The author has said in a Reddit post that “It’s based only on tkinter. Zero package dependencies. And it’s a single .py file. That means not much can go wrong.” And that it “Works in Windows, Linux, Mac. Running on my Pi board that has 3.4 installed on it.”

Tech Tip: Really Simple HTTP Server with Python

If you need a quick web server running and you don’t want to mess with setting up apache or something similar, then Python can help. Python comes with a simple builtin HTTP server. With the help of this little HTTP server you can turn any directory in your system into your web server directory. The only thing you need to have installed is Python.

Practically speaking this is very useful to share files inside your local network. Implementing this tiny but hugely useful HTTP server is very simple…

Source: Tech Tip: Really Simple HTTP Server with Python | Linux Journal

Recent Posts

Recent Comments

Archives

Categories

Meta

GiottoPress by Enrique Chavez