Skip to main content
Help us improve Python packaging – donate today!

Quick-and-dirty debugging output for tired programmers

Project Description

[![Build Status](https://travis-ci.org/zestyping/q.svg)](https://travis-ci.org/zestyping/q)

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()

The following [Lightning Talk](http://pyvideo.org/video/1858/sunday-evening-lightning-talks#t=25m15s) shows how powerful using q can be.

Release history Release notifications

This version
History Node

2.6

History Node

2.5

History Node

2.4

History Node

2.3

History Node

2.2

History Node

2.1

History Node

2.0

History Node

1.1

History Node

1.0

History Node

0.01

History Node

0.00

History Node

0.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
q-2.6-py2.py3-none-any.whl (6.8 kB) Copy SHA256 hash SHA256 Wheel 2.7 Jun 22, 2015
q-2.6.tar.gz (7.7 kB) Copy SHA256 hash SHA256 Source None Jun 22, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page