我从python脚本调用一个方法,其中一个变量是args。 一旦我进入该方法,当我试图查看变量args的值时,“print args”和执行“args”将显示两个不同的值。 有谁能告诉我这两个命令有什么区别吗。在
我希望这两个命令显示相同的值。在
(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, 'evacuateAllData': True, 'WaitTime': None, 'IssueType': 'Host Disconnect', 'performObjectUpgrade': True, 'downgradeFormat': False}
result = True
args
是一个PDB调试器命令。使用!args
显示实际变量。在参见Debugger Commands section:
以及
(重点是我的)。在
在您的
args
输出中,您可以在第一行看到args
参数值。在就我个人而言,我发现},或者BeautifulSoup元素与HTML字符串的对比等等)。在
(a)rgs
命令有点毫无意义;它使用str()
而不是repr()
来打印所有值;这使得具有类似__str__
输出值的对象之间的差异不可见(例如str
与{相关问题 更多 >
编程相关推荐