Skip to main content

Print two files side-by-side (in columns)

Project description

Print two outputs side-by-side, in Python

side_by_side allows users to print two multi-line outputs side-by-side. This produces an effect similar to running diff -y file1 file2 in a Unix system.

Usage

This library provides a single function, side_by_side.print_side_by_side. To print two_strings side-by-side with default settings:

from side_by_side import print_side_by_side

print_side_by_side(s1, s2)

lorem ipsum output with typical usage

Optional parameters

  • print_line_numbers (bool): If True, prints line-numbers along the left column.
  • col_padding (int): the number of spaces to leave between the two columns (and between the text and line number, if applicable)
  • delimiter (str): a delimiter to separate the columns

Fancy usage

Here's an example of a print format that uses all of the parameters:

from side_by_side import print_side_by_side

print_side_by_side(lorem_ipsum, lorem_ipsum, print_line_numbers=True, col_padding=24, delimiter='|++++|')

lorem ipsum output with typical usage

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

side-by-side-0.0.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

side_by_side-0.0.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file side-by-side-0.0.1.tar.gz.

File metadata

  • Download URL: side-by-side-0.0.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for side-by-side-0.0.1.tar.gz
Algorithm Hash digest
SHA256 bfa2059f509d224bce725ea4be8cfde08bb05a31b5f217a43d7fe5a05ddc163c
MD5 9e177b374b7c4c29ee9a53eef818018f
BLAKE2b-256 1ea88a71850fc5af8681fd932521fbb790e4c1b9b4d02ba2df3f1ef39747ea2b

See more details on using hashes here.

Provenance

File details

Details for the file side_by_side-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: side_by_side-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for side_by_side-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e3fd174535c5e71ee0d8681f073142a1fdc1f2ff1fc80b96d4b9ea560159d9e
MD5 2defbc849ea7419380b52ad0a1b8c956
BLAKE2b-256 1d2c36b05b8a742378a447583dc3815d200e32752afaca99eb33134edef4f746

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page