pdb

Python debugger (pdb) stopped handlying up/down arrows, shows ^[[A instead

大城市里の小女人 提交于 2019-12-01 14:55:47
I am using python 2.6 in a virtualenv on an Ubuntu Linux 11.04 (natty) machine. I have this code in my (django) python code: import pdb ; pdb.set_trace() in order to launch the python debugger (pdb). Up until today, this worked fine. But now when the pdb starts, it works for debugging and running and breakpoints etc, but when I press the up arrow to show the previous command it prints ^[[A instead an doesn't go up. When I type something and press Home , it prints ^[OH instead of moving the cursor. I can use up/home/etc. fine in the bash terminal which launches my python django unittests (which

Python debugger (pdb) stopped handlying up/down arrows, shows ^[[A instead

六月ゝ 毕业季﹏ 提交于 2019-12-01 13:41:39
问题 I am using python 2.6 in a virtualenv on an Ubuntu Linux 11.04 (natty) machine. I have this code in my (django) python code: import pdb ; pdb.set_trace() in order to launch the python debugger (pdb). Up until today, this worked fine. But now when the pdb starts, it works for debugging and running and breakpoints etc, but when I press the up arrow to show the previous command it prints ^[[A instead an doesn't go up. When I type something and press Home , it prints ^[OH instead of moving the

Python里三个最高逼格的调试神器

本小妞迷上赌 提交于 2019-12-01 08:47:13
调试是开发过程中不可避免的一个环节,在Python中我们使用print、logging、assert等方法进行调试既简单又实用,但毕竟有其局限性。今天这篇文章为大家带来三个工具,其中有Python的内置模块也有第三方库,它们提供了调试代码所需的大部分常用功能,将极大的提升我们的开发和bug排除效率。 1.PDB pdb是Python中的一个内置模块,启用pdb后可以对代码进行断点设置和跟踪调试。为了演示方便,我们准备一个样例程序pdb_test.py: def countnumber(number): for i in range(number): print(i) if __name__ == '__main__': countnumber(10) 之后在终端中输入python -m pdb pdb_test.py命令,进入pdb的调试模式: 这时我们就可以通过各种命令控制代码执行或者查看当前变量,例如l可以查看所有代码,n是执行下一步代码,p可以查看当前变量等等,需要注意的是命令n只会执行主程序中的代码,如果想要单步执行子函数中的代码,需要使用s指令,调试效果如下: 这时我们就可以通过各种命令控制代码执行或者查看当前变量,例如l可以查看所有代码,n是执行下一步代码,p可以查看当前变量等等,需要注意的是命令n只会执行主程序中的代码,如果想要单步执行子函数中的代码,需要使用s指令

12c多租户架构下部署GoldenGate 12c

為{幸葍}努か 提交于 2019-12-01 08:05:33
12c多租户架构下部署GoldenGate 12c 原创 Oracle 作者:hooca 时间:2016-07-06 12:17:55 549 0 OS:Oracle Linux 6.6 x64和Windows Server 2008 R2 x64 DB:Oracle 12.1.2.0 GoldenGate:12.2.0.1.1 注意:先参考 https://blog.csdn.net/rgb_rgb/article/details/77346017 不然会掉坑!! 环境简单描述: 源端和目的端都是CDB/PDB架构,源端主库prod,目的端主库east;两端都含有名为pdb1的PDB。源端pdb1中含有名为sh的schema。 一、安装 1.1 Linux安装 环境变量: 点击( 此处 )折叠或打开 export GGS_HOME = / u01/ggs_1 LD_LIBRARY_PATH和PATH都要加上$GGS_HOME。如果使用的是oracle用户以外的用户,需加上ORACLE_HOME和ORACLE_SID变量。 1.2 Windows安装 在系统变量中加上ORACLE_HOME和ORACLE_SID变量。 1.3 安装完成后 在命令行中进入$GGS_HOME目录,运行ggsci,创建相关subdirs 点击( 此处 )折叠或打开 > create subdirs 二

Two different values for same variable “args”

耗尽温柔 提交于 2019-12-01 06:19:42
I am invoking a method from python script which has one of the variable as args. Once I step into the method, when I am trying to see the value of the the variable args, "print args" and just executing 'args' display two different values. Can anyone please let me know whats the difference between these two commands. I expected both the commands to display same value. (Pdb) print args <lib.framework.testmanager.RunArgs object at 0xb26acac> (Pdb) args args = <lib.framework.testmanager.RunArgs object at 0xb26acac> u = <upgradelib.UpgradeManager object at 0x946cf8c> spec = {'excludeHosts': None,

Two different values for same variable “args”

本小妞迷上赌 提交于 2019-12-01 05:37:32
问题 I am invoking a method from python script which has one of the variable as args. Once I step into the method, when I am trying to see the value of the the variable args, "print args" and just executing 'args' display two different values. Can anyone please let me know whats the difference between these two commands. I expected both the commands to display same value. (Pdb) print args <lib.framework.testmanager.RunArgs object at 0xb26acac> (Pdb) args args = <lib.framework.testmanager.RunArgs

How can I debug manually typed expression and statements in pdb?

被刻印的时光 ゝ 提交于 2019-12-01 05:25:07
In pdb (or ipdb) we can execute statements and evaluate expressions with the ! or p commands : p expression Evaluate the expression in the current context and print its value. [!]statement Execute the (one-line) statement in the context of the current stack frame. The exclamation point can be omitted unless the first word of the statement resembles a debugger command. To set a global variable, you can prefix the assignment command with a global command on the same line So, for example, I can type p reddit.get_subreddits() while debugging in ipdb and the code will be executed in the current

Save breakpoints to file

北城以北 提交于 2019-12-01 04:57:28
When debugging my Python code, I run a script through ipdb from the commandline, and set a number of breakpoints. Then I make some changes in one or more modules, and rerun. However, if I simply use run modules do not get reloaded . To make sure they do, I can exist and restart Python completely, but then I need to reset all breakpoints, which is tedious if I have many and if done over and over again. Is there a way to save breakpoint to a file in (i)pdb, so that after small changes that do not change line numbers, I can dump my breakpoints, restart Python + pdb, and reload my breakpoints? The

Django Gunicorn Debug

柔情痞子 提交于 2019-12-01 03:27:30
Initially I had a Django app with the included testing server. To debug this setup, I can just add a import pdb; pdb.set_trace() anywhere in the code and have a breaking point that throws me into an interactive debugger in Terminal (on command-line). Recently I shifted to gunicorn to gain some perf benifits. How can I get a similar behavior while using this Gunicorn setup. I have tried by setting gunicorn settings with debug=True and daemon=False but it does not work. Anyone has a solution to this? To run green unicorn in a reverse proxy configuration (under nginx) in a debugger / debug mode,

Save breakpoints to file

左心房为你撑大大i 提交于 2019-12-01 03:08:13
问题 When debugging my Python code, I run a script through ipdb from the commandline, and set a number of breakpoints. Then I make some changes in one or more modules, and rerun. However, if I simply use run modules do not get reloaded. To make sure they do, I can exist and restart Python completely, but then I need to reset all breakpoints, which is tedious if I have many and if done over and over again. Is there a way to save breakpoint to a file in (i)pdb, so that after small changes that do