The struct module includes functions for converting between strings of bytes and native Python data types such as numbers and strings.
Read more…
This post is part of the Python Module of the Week series for Python 3. See PyMOTW.com for more articles from the series.
This year marks the 10th anniversary of the first post for the Python Module of the Week series. What started as an exercise to push myself to write on a regular basis has, thanks to all of you, evolved into a much more long-lived and popular endeavor than I ever expected. A project of this scope is truly a group effort, and I have been fortunate to find good people to work with.
The zipfile module can be used to manipulate ZIP archive files, the format popularized by the PC program PKZIP.
Read more…
This post is part of the Python Module of the Week series for Python 3. See PyMOTW.com for more articles from the series.
Regular expressions are text matching patterns described with a formal syntax. The patterns are interpreted as a set of instructions, which are then executed with a string as input to produce a matching subset or modified version of the original. The term “regular expressions” is frequently shortened to as “regex” or “regexp” in conversation. Expressions can include literal text matching, repetition, pattern-composition, branching, and other sophisticated rules. A large number of parsing problems are easier to solve with a regular expression than by creating a special-purpose lexer and parser.
The string module dates from the earliest versions of Python. Many of the functions previously implemented in the module have been moved to methods of str objects. The string module retains several useful constants and classes for working with str objects, and this discussion will concentrate on them.
Read more…
This post is part of the Python Module of the Week series for Python 3. See PyMOTW.com for more articles from the series.
The gzip module provides a file-like interface to GNU zip files, using zlib to compress and uncompress the data.
Read more…
This post is part of the Python Module of the Week series for Python 3. See PyMOTW.com for more articles from the series.
Last week at the OpenStack Forum in Boston, the Release Team gave an onboarding orientation session with the goal of attracting new contributors to the team.
While Python is the “Batteries Included” programming language and comes with a wide variety of modules in the standard library, there are even more libraries, frameworks, and tools available to be installed from the Python Package Index . To install those packages, a developer needs the installer tool pip . Installing a tool meant to install tools presents an interesting bootstrapping issue, which ensurepip solves.
Read more…
This post is part of the Python Module of the Week series for Python 3.
Python virtual environments are set up for installing packages and running programs in a way that isolates them from other packages installed on the rest of the system. Because each environment has its own interpreter executable and directory for installing packages, it is easy to create environments configured with various combinations of Python and package versions all on the same computer.
Read more…
This post is part of the Python Module of the Week series for Python 3.