Skip to main content

Python printer configurations.

Project description

In development

In the mean time, here are some tips to help you get started:

from confprint import prefix_printer


p_test1 = prefix_printer(prefix="test1")
p_test1("Preset")

p_test2 = prefix_printer(prefix="test2", upper=False)
p_test2("unaltered text")

p_test3 = prefix_printer(prefix="test3", stderr=True)
p_test3("using sys.stderr.write as the print function")

p_test4 = prefix_printer(prefix="test4", click=True)
p_test4("using click.echo as the print function")

p_test5 = prefix_printer(prefix="test5", frame_left="( ", frame_right=" )")
p_test5("using custom frame characters")

p_test1(
    """With new lines in strings the text is converted
to multiline, then all but the first are
indented to line up with therest."""
)

p_test1(
    "The next example wil not be ending with a `:`, "
    "since it has no input.\nAnd as you can see, this is also a multiline text."
)

p_done()

Output:

[TEST1]: Preset

[test2]: unaltered text

[TEST3]: using sys.stderr.write as the print function

[TEST4]: using click.echo as the print function

( TEST5 ): using custom frame characters

[TEST1]: With new lines in strings the text is converted
         to multiline, then all but the first are
         indented to line up with therest.

[TEST1]: The next example wil not be ending with a `:`, since it has no input.
         And as you can see, this is also a multiline text.

[DONE]

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

confprint-0.1.1.tar.gz (7.1 kB view hashes)

Uploaded Source

Built Distribution

confprint-0.1.1-py3-none-any.whl (6.5 kB view hashes)

Uploaded Python 3

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