Quick-and-dirty debugging output for tired programmers
Project description
[](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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file q-2.6.tar.gz
.
File metadata
- Download URL: q-2.6.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | de0fcf5a439754975dd8022c3bf26374b882d0fe4265aab8813f4e87e057eed5 |
|
MD5 | 0251ce38a2dce77917a8929d7968e035 |
|
BLAKE2b-256 | 3a2784b34e4b210da8bd029ba3275517d824ef8ea15ca63564c26dfaebc53b58 |
File details
Details for the file q-2.6-py2.py3-none-any.whl
.
File metadata
- Download URL: q-2.6-py2.py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8687008a5b50ddc1c114392a37591cb4fbe082dcc8b02bdc6692689c69d08314 |
|
MD5 | c8c99db977b56606bd15a91d12fcdc1e |
|
BLAKE2b-256 | 53bc51619d89e0bd855567e7652fa16d06f1ed36a85f108a7fe71f6629bf719d |