精华内容
下载资源
问答
  • 2017/3/12 27.3 pdb Python Debugger Python 3.6.1rc1文档 27.3pdb Python的调试器 源代码 Lib / pdb.py 该模块pdb为Python程序定义了一个交互式源代码调试器它支持在任何堆栈帧的上下文中设 置 条件 断点和在源行级...
  • The Python Debugger Python自带交互式源代码调试器,在代码中设置断点,单步执行。 调试脚本 逐句调试 python -m pdb filename.py 方法 .run 在调试器控制下执行语句。 .runeval 在调试器控件下测试表达式...

    The Python Debugger

    • Python自带交互式源代码调试器,在代码中设置断点,单步执行。

    调试脚本

    • 逐句调试
    python -m pdb filename.py
    

    方法

    .run

    • 在调试器控制下执行语句。

    .runeval

    • 在调试器控件下测试表达式(以字符串形式给出)。当runeval()返回时,它返回表达式的值。否则此功能类似于run()。

    .runcall

    • 使用给定的参数调用函数

    .set_trace()

    • 创建一个调试器。

    .post_mortem

    • 输入给定回溯对象的事后调试。如果没有给出回溯,它将使用当前正在处理的异常之一(如果要使用默认值,则必须处理异常)。

    .pm()

    • 输入在中找到的回溯的事后调试 sys.last_traceback。

    调试器类

    • class pdb.Pdb(completekey=‘tab’, stdin=None, stdout=None, skip=None, nosigint=False, readrc=True)

    Pdb 是调试器类。详细信息

    调试器命令

    • h(elp) [command]

    获得command的帮助信息。

    • w(here)

    打印堆栈跟踪,当前堆栈

    • d(own)

    打印下一个堆栈信息。

    • u( p )

    打印上一个堆栈信息。

    • b(reak) [[filename:]lineno | function[, condition]]

    使用lineno参数,在文件中设置中断,执行break。

    • tbreak [[filename:]lineno | function[, condition]]

    临时断点,在第一次被击中时自动删除。参数与break相同。

    • cl(ear) [filename:lineno | bpnumber [bpnumber …]]

    使用filename:lineno参数,清除此行的所有断点。

    • disable [bpnumber [bpnumber …]]

    禁用以空格分隔的断点号列表给出的断点。禁用断点意​​味着它不能导致程序停止执行,但与清除断点不同,它会保留在断点列表中并可以(重新)启用。

    • enable [bpnumber [bpnumber …]]

    启用指定的断点。

    • ignore bpnumber [count]

    设置给定断点号的忽略计数。如果省略count,则忽略计数设置为0.当忽略计数为零时,断点将变为活动状态。当非零时,每次到达断点时计数都会递减,并且断点未被禁用且任何关联条件的计算结果为true。

    • condition bpnumber [condition]

    Condition是一个表达式,在断点被接受之前必须求值为true。如果条件不存在,则删除任何现有条件; 即,断点是无条件的。

    • commands [bpnumber]

    指定断点号bpnumber的命令列表。命令本身出现在以下行中。键入仅包含’end’的行以终止命令。

    (Pdb) commands 1
    (com) print some_variable
    (com) end
    (Pdb)
    
    • s(tep)

    执行当前行,在第一个可能的场合停止(在被调用的函数中或在当前函数的下一行中停止)。

    • n(ext)

    继续执行,直到达到当前函数中的下一行或返回。

    • unt(il)

    继续执行,直到达到行号大于当前行的行或从当前帧返回。

    • r(eturn)

    继续执行,直到当前函数返回。

    • c(ont(inue))

    继续执行,仅在遇到断点时停止。

    • j(ump) lineno

    设置将要执行的下一行。

    • l(ist) [first[, last]]

    列出当前文件的源代码。

    • a(rgs)

    打印当前函数的参数列表。

    • p expression

    评估当前上下文中的表达式并打印其值。

    • pp expression

    与p命令一样,除了表达式的值使用pprint模块进行漂亮打印。

    • alias [name [command]]

    创建一个名为name的别名来执行命令。

    • unalias name

    删除指定的别名。

    • [!]statement

    在当前堆栈帧的上下文中执行(一行)语句。除非语句的第一个单词类似于调试器命令,否则可以省略感叹号。要设置全局变量,可以在赋值命令的global前面加上同一行的命令,例如:

    (Pdb) global list_options; list_options = ['-l']
    (Pdb)
    
    • run [args …]

    重新启动调试的Python程序。

    • q(uit)

    退出调试器。正在执行的程序被中止。

    展开全文
  • Python debugger

    2021-01-07 12:09:36
    s no debugger extension for it, but it also complained about <code>console: none</code> and, obviously, the <code>django</code> key: <pre><code>json { "name": "Django", "type&#...
  • python debugger hangs

    2021-01-07 13:40:00
    <p>integrated debugger hangs when single-stepping over chess-engine commands from python-chess which communicate with the stockfish chess engine. Note: continuing over the code, to a breakpoint later ...
  • 在Spyder中进行python开发时,调试是必不可少的。它主要依赖了pdb模块,pdb模块为Python开发者提供一个交互式的代码调试器。 发现该调试器和gdb有很多相似之处,这里罗列出几条常用的调试命令。 h(elp) [command]...

    在Spyder中进行python开发时,调试是必不可少的。它主要依赖了pdb模块,pdb模块为Python开发者提供一个交互式的代码调试器。

    发现该调试器和gdb有很多相似之处,这里罗列出几条常用的调试命令。


    h(elp) [command] Without argument, print the list of available commands. With a command as argument, print help about that command.helppdb displays the full documentation file; if the environment variablePAGER is defined, the file is piped through that command instead. Since thecommand argument must be an identifier,helpexec must be entered to get help on the! command.w(here) Print a stack trace, with the most recent frame at the bottom. An arrow indicates the current frame, which determines the context of most commands.  b(reak) [[filename:]lineno | function[, condition]]

    With a lineno argument, set a break there in the current file. With afunction argument, set a break at the first executable statement within that function. The line number may be prefixed with a filename and a colon, to specify a breakpoint in another file (probably one that hasn’t been loaded yet). The file is searched onsys.path. Note that each breakpoint is assigned a number to which all the other breakpoint commands refer.

    If a second argument is present, it is an expression which must evaluate to true before the breakpoint is honored.

    Without argument, list all breaks, including for each breakpoint, the number of times that breakpoint has been hit, the current ignore count, and the associated condition if any.

    cl(ear) [filename:lineno | bpnumber [bpnumber ...]]With a filename:lineno argument, clear all the breakpoints at this line. With a space separated list of breakpoint numbers, clear those breakpoints. Without argument, clear all breaks (but first ask confirmation).disable [bpnumber [bpnumber ...]] Disables the breakpoints given as a space separated list of breakpoint numbers. Disabling a breakpoint means it cannot cause the program to stop execution, but unlike clearing a breakpoint, it remains in the list of breakpoints and can be (re-)enabled.enable [bpnumber [bpnumber ...]] Enables the breakpoints specified. s(tep) Execute the current line, stop at the first possible occasion (either in a function that is called or on the next line in the current function).n(ext) Continue execution until the next line in the current function is reached or it returns. (The difference between next andstep is that step stops inside a called function, whilenext executes called functions at (nearly) full speed, only stopping at the next line in the current function.)unt(il)

    Continue execution until the line with the line number greater than the current one is reached or when returning from current frame.

    New in version 2.6.

    r(eturn) Continue execution until the current function returns. c(ont(inue)) Continue execution, only stop when a breakpoint is encountered.a(rgs) Print the argument list of the current function. run [args ...]

    Restart the debugged Python program. If an argument is supplied, it is split with “shlex” and the result is used as the new sys.argv. History, breakpoints, actions and debugger options are preserved. “restart” is an alias for “run”.

    New in version 2.6.

    q(uit)

    Quit from the debugger. The program being executed is aborted. 


    和gdb类似的是,pdb状态下连续回车,则重复执行最近的一次debug命令



    展开全文
  • C:\Users\Administrator\.vscode\extensions\ms-python.python-2018.3.1\pythonFiles\PythonTools\visualstudio_py_debugger.py", line 30, in <module> import ctypes ImportError: No module named ...
  • <p>Looking at the output of </p><pre><code>lsof -nP -iTCP | grep LISTEN</code></pre>, there are several python processes listening on ports, but none of them are on the port the debugger is trying to ...
  • python debugger

    2011-08-11 09:33:00
    python -m pdb script.py (Pdb) 会自动停在第一行,等待调试,这时你可以看看 帮助 (Pdb) h   断点设置  (Pdb)l #查看代码上下文  (Pdb)b 10 #断点设置在本py的第10行  (Pdb)b ots.py:20 #断点设置到 ots....

    http://www.codeproject.com/KB/DLL/PasswordSPY.aspx
    http://www.codeproject.com/KB/dialog/windowfinder.aspx

    python -m pdb script.py
    (Pdb) 会自动停在第一行,等待调试,这时你可以看看 帮助
    (Pdb) h
      
    断点设置
        (Pdb)l                            #查看代码上下文
       (Pdb)b  10                    #断点设置在本py的第10行
       (Pdb)b  ots.py:20         #断点设置到 ots.py第20行
      (Pdb)b                         #查看断点编号
        (Pdb)cl 2                         #删除第2个断点
       
    运行
        (Pdb)n                         #单步运行
        (Pdb)s                         #细点运行 也就是会进入方法
        (Pdb)c                         #运行到断点
    查看
        (Pdb)p param             #查看当前 变量值
        (Pdb)l                         #查看运行到某处代码
        (Pdb)a                         #查看全部栈内变量
        (Pdb)r                            #执行到函数返回前

    展开全文
  • Provide Python debugger

    2020-12-08 20:21:59
    <div><p>Just creating this issue so that I am subscribed for this. Happy to test when something shows up in this direction :)</p><p>该提问来源于开源项目:solo-io/kubesquash</p></div>
  • added Python Debugger

    2020-12-06 04:50:54
    <div><ul><li>Link to your code repository: ...
  • support Python debugger

    2020-11-30 02:19:32
    <div><p>running with daemon and set breakpoint via <code>import pdb; pdb.set_trace()</code></p> <p>program can't pause on breakpoint and just restarts</p><p>该提问来源于开源项目:...
  • <div><p>I foolishly updated to the new python debugger in Visual Studio 2017 (15.7.4) and now I cannot debug anymore. I get this error: <pre><code> pydev debugger: starting Traceback (most recent ...
  • Python Version: Ironpython 2.7.3 (2.7.0.40) OS and version: window 10 <h2>Actual behavior <p>i could not get Debug ouput with Ironpython (ipw64.exe) as python.PythonPath <h2>Expected behavior <p>want ...
  • web python debugger stuck

    2020-12-26 08:44:54
    But after that , when I want to quit the session, it just stuck or hang , and I reload the web debugger, it shows the same which is the last command I used which is <code>continue</code> . I could ...
  • F/debugger cli in python

    2020-11-27 20:35:54
    <div><p>This branch actually completes the initial batch to support command completion in the syslog-ng interactive debugger. <p>Right now it is able to use completion on: - the debug commands ...
  • <div><p>Hi, another strange issue: migrating everything to another machine, which runs Linux Mint 20, I got the error "No such file or directory: '...daveleroy/sublime_debugger</p></div>
  • pycharm报Python Debugger Extension Available Cython extension speeds up Python debugging 15:58 Python Debugger Extension Available Cython extension speeds up Python debugging ...

    pycharm报Python Debugger Extension Available Cython extension speeds up Python debugging

    15:58    Python Debugger Extension Available
                Cython extension speeds up Python debugging
                Install How does it work

    点击安装还报错。

    如果是windows,忽略即可。参见保住文档:

    Windows:You don't need to do anything. We've bundled precompiled extensions, so you're already using them.

    其他情况参见https://www.jetbrains.com/help/pycharm/2017.2/cython-speedups.html

     

    展开全文
  • Pdb(Python debugger): 主旨:方便在开发、测试、DEBUG时的代码调试 命令行运行: 直接在运行脚本时 添加-m pdb参数,如下: python -m pdb my_script.py 脚本内部运行: 在代码中需要调试处...
  • I installed sublime_debugger and chose VScode Python as debugger successfully. Although my sublime build-system is under Python 3.7, the debugger only uses Python 2.7 for the runpy.py. Does this ...
  • <ul><li>VS Code version: 1.27.1</li><li>Extension version (available under the Extensions sidebar): 2018.8.0</li><li>OS and version: Windows 7</li><li>Python version (& distribution if applicable,...
  • When trying to start the python debugger. I get an Error: <p><code>Error: Cannot find module '/home/predrag/.../Packages/sublime_db/debug_adapters/vscode-python/extension/out/client/debugger/...
  • <p>Debugger runs current python file <h2>Steps to reproduce: <ol><li>Open any python file</li><li>Click on Debug Menu and click "Start Debugging"</li><li>See Attribute error in the debug ...
  • python 调试报错 Connection to Python debugger failed socket closed 点击调试按钮报错,同时显示AttributeError: module ‘http.client’ has no attribute ‘HTTPMessage’。网上的改文件命名和更改setting里面...
  • <p>When restarting the Python Debug Adapter (as opposed to stopping it), a new debugger process is started, but the old one is not killed. <p>I have replicated the issue on both MacOS Mojave and ...
  • <p>The issue is that debugger gets control quicker than Python interpreter apparenttly. I have a try except for KeyError that throws KeyError within the try block...</p><p>该提问来源于开源项目:...
  • If I debug my python script in the vscode python debugger its extremly slow (About 20+ sec). <p>But on cmd if I go to the path where the script is and execute it with the same python interpreter...
  • 几种python debugger简介

    2020-10-15 10:51:15
    a python module so can be executed by python -m pdb <source_file> Usage python -m pdb <source_file> actually call Pdb()._runscript(source_file) insert by code:import pdb pdb.set_tra
  • The Python Debugger Command

    2012-08-12 16:26:00
    文档:http://docs.python.org/library/pdb.htmlThe debugger recognizes the following commands. Most commands can be abbreviated to one or two letters; e.g. h(elp) means that either h or help can be used...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 3,063
精华内容 1,225
关键字:

debuggerpython

python 订阅