特别是只用VIM这种文本编辑器写代码的条件下,你是怎么调试Python代码的?
|
cJul 8, 2011
1
logging & print
|
|
2
@c 是这里的logging吗?http://docs.python.org/howto/logging-cookbook.html
|
|
3
看来是这里的howto入门更简单点http://docs.python.org/howto/logging.html
|
|
reorxJul 8, 2011
4
|
|
qichangxingJul 9, 2011
6
刷页面,看 Bug 信息。
看控制台出错代码。 |
|
shawizJul 9, 2011
7
import pdb; pdb.set_trace()
|
|
qichangxingJul 11, 2011
8
|
|
blackbirdJul 11, 2011
9
例如有一个数十个模块1000行以上的文本处理代码,
比起对照日志,用调试器跟踪肯定更方便。 |
|
sqbingJul 18, 2011
10
打日志,难道还有别的?
|
|
estJul 18, 2011
11
python -i
|
|
dreampufJul 18, 2011
12
logging & unittest 与 debug 结合.
何时使用看具体情况,如果新环境调试什么的,debug非常便捷.但是debug是打水漂,每次投入精力后并不能复用. 而logging&unittest则是"为你的未来投资".复用,简单,清晰,而且可以递增. |