Skip to main content

Quick-and-dirty debugging output for tired programmers

Project description

Quick and dirty debugging output for tired programmers.

Install q with “easy_install -U q” or “pip install -U q”.

All output goes to /tmp/q, which you can watch with this shell command:

tail -f /tmp/q

If TMPDIR is set, the output goes to $TMPDIR/q.

To print the value of foo, insert this into your program:

import q; q(foo)

To print the value of something in the middle of an expression, insert “q()”, “q/”, or “q|”. For example, given this statement:

file.write(prefix + (sep or '').join(items))

…you can print out various values without using any temporary variables:

file.write(prefix + q(sep or '').join(items))  # prints (sep or '')
file.write(q/prefix + (sep or '').join(items))  # prints prefix
file.write(q|prefix + (sep or '').join(items))  # prints the arg to write

To trace a function’s arguments and return value, insert this above the def:

import q
@q

To start an interactive console at any point in your code, call q.d():

import q; q.d()

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

q-2.5.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

q-2.5-py2.py3-none-any.whl (6.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file q-2.5.tar.gz.

File metadata

  • Download URL: q-2.5.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for q-2.5.tar.gz
Algorithm Hash digest
SHA256 d115f95058f18250faec0b7fe8a86a926939e5df215dcdbf8729906d9a34b657
MD5 d4c4ee489dea818f85dfcfb9156fe8de
BLAKE2b-256 9ab4962f8fb886576ae86bb09a813c9f15a03de162cc3faf0bb621bb4d0fa415

See more details on using hashes here.

File details

Details for the file q-2.5-py2.py3-none-any.whl.

File metadata

  • Download URL: q-2.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for q-2.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d323f6b88252303646373c1dec90544292cc634f1bc8d87b92d81b78be9208b6
MD5 fff32d6bd60ed1ac21d8574171a21227
BLAKE2b-256 4e59a1f7a29cfb4ded2de0078422511a9ed592ea772b26d1b6774c8f94e0eff2

See more details on using hashes here.

Supported by

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