Skip to content
프로젝트

zestyping/q has 1,302 GitHub stars and 65 forks. GitHot measured 0 in 7 days. Last checked 2026-11-10 20:18 UTC. Last push 2023-12-18.

이 수치를 측정하는 방법

Quick and dirty debugging output for tired programmers. ⛺

측정된 스타 증가

in 24h
업데이트 지연
in 7 days
0
in 15 days
업데이트 지연
in 1 month
업데이트 지연

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

q

Code Shelter

Quick and dirty debugging output for tired programmers.

For a short demo, watch the Lightning Talk from PyCon 2013.

Install q with pip install -U q.

All output goes to /tmp/q (or on Windows, to $HOME/tmp/q). You can watch the output with this shell command while your program is running:

tail -f /tmp/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, you can wrap it with q(). You can also insert q/ or q| into the expression; q/ binds tightly whereas q| binds loosely. 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 (showing its arguments, return value, and running time), 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()

By default the output of q is not truncated, but it can be truncated by calling:

q.short

Truncation can be reversed by:

q.long # Truncates output to 1,000,000
q.long = 2000000 # Truncates output to 2,000,000

Other projects inspired by this one

The following Lightning Talk shows how powerful using q can be.

관련 프로젝트 살펴보기