Skip to main content

Powerful debugging tool for Python.

Project description

Simple print

Print value with variable name.
Userful for fast debugging.


To install run:

pip install simple-print

Print variables with names

Full example you can see here.

master = "yoda" # variable name master
sprint(master, c="blue") 
sprint(master, c="blue", b="on_white") 
sprint(master, c="blue", b="on_white", a="underline") 
sprint(master, c="blue", b="on_white", a="bold", p=True) 
my_string = sprint(master, s=True) # return as string
my_string = sprint(master, s=True, p=True) # return as string with path to file 

p param is False by default, but you can override this behavior with SIMPLE_PRINT_PATH_TO_FILE=True in your local environment.

Fn params:

c color [grey, red, green, yellow, blue, magenta, cyan, white]
b background [on_grey, on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan]
a attribute [bold, dark, underline, blink, reverse, concealed]
p path [with path to file]
i indent [indent 1..40]
s string [return as string]
f force print [ignore SIMPLE_PRINT_ENABLED=False for docker production logs for example]

Example with indent

For indent use i param. Full example you can see here.

def test_indent():
    fruits = ["lemon", "orange", "banana"]
    sprint(fruits, c="green")  
    for fruit in fruits:
        sprint(fruit, c="yellow", i=4)

Pretty error tb

Show errors with pretty traceback:

from simple_print import SprintErr

with SprintErr():
    raise ValueError


Stop printing:


Always show path to file:




Project details

Download files

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

Source Distributions

No source distribution files available for this release. See tutorial on generating distribution archives.

Built Distribution

simple_print- (10.5 kB view hashes)

Uploaded py3

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