Skip to main content

collection of useful python functions

Project description

ssutils

collection of useful python functions

Screenwriter

Use Screenwriter to prefix screen prints Examples

1 - Default prefix

from ssutils import Screenwriter

sw = Screenwriter ()
sw.echo ('my output')
Output:
2019-07-26-11:16:04 my output

2 - Date Time parts in prefix

from ssutils import Screenwriter

sw = Screenwriter ('%Y-%m-%d %H:%M:%S.%f ')
sw.echo ('my output')
Output:
2019-07-26 11:16:04 my output

3 - Error, Warning & Info standard prefixes

from ssutils import Screenwriter

sw = Screenwriter ()
sw.error ('an error message')
sw.warn  ('a warming message')
sw.info  ('an informational message')
Output:
2019-07-29-11:39:00 ERROR: an error message
2019-07-29-11:39:00 WARN:  a warming message
2019-07-29-11:39:00 INFO:  an informational message

For format options, see http://strftime.org/

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

ssutils-0.1.1.tar.gz (1.7 kB view hashes)

Uploaded Source

Built Distribution

ssutils-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