Pyxdebug is Xdebug format debuger for Python
pyxdebug的Python项目详细描述
调试调用函数:
xd = PyXdebug() #xd.collect_imports = 1 #xd.collect_params = 0 #xd.collect_return = 0 #xd.collect_assignments = 0 xd.run_func(func) print xd.get_result()
调试执行语句:
xd = PyXdebug() xd.run_statement(statement) print xd.get_result()
调试运行脚本文件:
python pyxdebug.py script_path
调试运行脚本文件(模块):
python -m pyxdebug script_path
用法:pyxdebug.py[-o输出文件路径][-i收集导入][-p收集参数][-r收集返回][-a收集分配]脚本路径[参数…]
- 选项:
-h, --help show this help message and exit -o, --outfile Save stats to <outfile> -i, --collect_imports This setting, defaulting to 1, controls whether PyXdebug should write the filename used in import or reload to the trace files. -p, --collect_params This setting, defaulting to 0, controls whether PyXdebug should collect the parameters passed to functions when a function call is recorded in either the function trace or the stack trace. -r, --collect_return This setting, defaulting to 0, controls whether PyXdebug should write the return value of function calls to the trace files. -a, --collect_assignments This setting, defaulting to 0, controls whether PyXdebug should add variable assignments to function traces.