Skip to main content

Include the variable name in print statements

Project description

smartprint

Save a few seconds and a few keystrokes with every print statement! 😎

  • Everytime you want to print something, you lose a few seconds to type in the name of the variable being printed
  • Worse still, your IDE helps you autocomplete long variable names but does not autocomplete the print comments

Your usual print statment:

print ("veryLongVariableName : ", veryLongVariableName)

Enter smart print:

from smartprint import smartprint as sprint

veryLongVariableName = 25
sprint (veryLongVariableName)

Output:

veryLongVariableName : 25

Works with multiple variables and all kinds of objects

from smartprint import smartprint as sprint 
import numpy as np 

a = [1,22,31]
sprint (a, len(a))
sprint (np.random.rand())

Output:

a, len(a) : [1, 22, 31] 3
np.random.rand() : 0.649617730484109

Installation

pip install smartprint

Issues

Please feel free to start a pull request/ raise an issue.

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

smartprint-0.1.1.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

smartprint-0.1.1-py3-none-any.whl (2.9 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