Pdiff is a command-line utility for generating pretty side-by-side differences between two text files. It is inspired by `ydiff` and `icdiff`, focusing on enhancing readability with color highlighting. The current version is 1.1.5, and it is actively maintained with infrequent but consistent updates.
pip install pdiffVerified import paths — ran on the pinned version, not inferred.
Pdiff is invoked from the command line. This quickstart demonstrates how to use `subprocess.run` in Python to execute `pdiff` and capture its output, comparing two temporary text files. Remember to have `pdiff` installed and available in your system's PATH for this to work.
Use `subprocess.run()` to execute `pdiff` as an external command, passing file paths as arguments, and capture its `stdout` for processing.
If piping, use tools that support ANSI escape codes (e.g., `less -R`). For programmatic capture, be prepared to strip ANSI codes if plain text is desired, or ensure the receiving environment can interpret them.
Always quote filenames (e.g., `pdiff "file with spaces.txt" other_file.txt`). When using `subprocess.run` in Python, pass filenames as separate elements in a list, which handles quoting automatically (e.g., `['pdiff', 'file with spaces.txt', 'other_file.txt']`).
No dependency data recorded yet.