Reverse Engineeringpythondebuggingdevelopmentstdlibinternationalization

Python Defaults

Provides dependency packages and tools for all supported Python 2 versions, runtime, development, and debugging support in Kali Linux. Includes utilities like debuggers, documentation tools, and source code scanners for internationalization.

Description

The python-defaults package collection offers metapackages that depend on all supported Python 2 implementations (currently python2.7), avoiding hardcoded dependencies on specific versions. This includes runtime packages like python-all and python2, development packages like libpython-all-dev and python-all-dev, and debugging packages like libpython-all-dbg and python-all-dbg. Future support for jython and ironpython may be added.

Development tools provide header files, static libraries, and config scripts (python2-config, python2-dbg-config) for building Python 2 modules or embedding the interpreter. Debug variants like python2-dbg and libpython2-dbg enable –pydebug configuration for troubleshooting dynamically loaded modules.

Included binaries offer essential Python 2 utilities: pdb2 (debugger), pydoc2 (documentation), pygettext2 (internationalization scanner equivalent to xgettext), pyversions (version info), pyclean/pycompile (bytecode management), and python2-doc for comprehensive HTML documentation.

How It Works

Metapackages like python-all, libpython-all-dev aggregate dependencies across Python 2 variants (primarily 2.7), enabling version-agnostic builds. Debug builds use --pydebug flag, prioritizing /usr/lib/python2.7/lib-dynload/debug for dynamic modules. Config tools (x86_64-linux-gnu-python2-config) output compiler/linker flags (--cflags, --libs). pygettext2 tokenizes Python source via Python's tokenize module to extract _() marked strings into .pot files compatible with GNU gettext workflow. pydoc2 serves HTML documentation or introspects modules/packages.

Installation

bash
sudo apt install python-defaults

Flags

-hShow help message (pdb2, pydoc2, pygettext2, pyversions, pyclean, pycompile)
-k wordKeywords to look for in addition to default _() for pygettext2
-a, --extract-allExtract all strings for pygettext2
-D, --docstringsExtract docstrings for pygettext2
-p <port>Start HTTP server on port for pydoc2
-d, --defaultPrint default Python version for pyversions
-s, --supportedPrint supported Python versions for pyversions
--prefixOutput prefix directory (python2-config, python2-dbg-config)
-v, --verboseVerbose mode (pyclean, pycompile, pygettext2)
-p PACKAGESpecify package name to clean/compile (pyclean, pycompile)

Examples

Show Python 2 debugger usage
pdb2 -h
Show Python 2 documentation tool usage
pydoc2 -h
Show text documentation for Python keyword, function, module, or source file
pydoc2 <name>
Start HTTP documentation server on specified port
pydoc2 -p <port>
Show Python gettext equivalent usage
pygettext2 -h
Show Python version information tool usage
pyversions -h
Print the default Python version
pyversions -d
Show Python bytecode cleaner usage
pyclean -h
Show Python 2 C/C++ extension build options
python2-config --help
Show Python 2 debug config options
x86_64-linux-gnu-python2-dbg-config --help
Updated 2026-04-16kali.org ↗