English 中文(简体)
Emacs: Methods for debugging python
原标题:Emacs: methods for debugging python

我在

我用心满足我的所有法典的需要。 典型的情况是,我将利用M-x汇编来管理我的测试操作员,我会说,在我需要做的70%左右,使守则走上正轨,然而,我很想知道,在什么时候可以使用M-x pdb来打断点和检查事情。

在我的演讲中,我发现,有些东西表明这有用/可行。 然而,我未能以我完全理解的方式开展工作。

我不知道,它是否把建筑外加机械混为一谈,这可能会使其更加困难,但在我试图做像这样的事情的时候。

M-x pdb
Run pdb (like this): /Users/twillis/projects/hydrant/bin/python /Users/twillis/bin/pdb /Users/twillis/projects/hydrant/bin/devappserver /Users/twillis/projects/hydrant/parts/hydrant-app/

如果....../bin/python是口译人员,则按照为所有鸡蛋规定的道路铺设。

~/bin/pdb是一种简单的文字,用现有的假肢译者打入纸浆。

HellooKitty:hydrant twillis$ cat ~/bin/pdb
#! /usr/bin/env python

if __name__ == "__main__":
    import sys
    sys.version_info
    import pdb
    pdb.main()
HellooKitty:hydrant twillis$ 

....../bin/devserver是“dev_appserver script that the Buildingout recipe made for gae Project”,....../parts/hydrant-app is the path to the appyaml.

I am first presented with a prompt

Current directory is /Users/twillis/bin/
C-c C-f

没有发生,

HellooKitty:hydrant twillis$ ps aux | grep pdb
twillis    469 100.0  1.6   168488  67188 s002  Rs+   1:03PM   0:52.19 /usr/local/bin/python2.5 /Users/twillis/projects/hydrant/bin/python /Users/twillis/bin/pdb /Users/twillis/projects/hydrant/bin/devappserver /Users/twillis/projects/hydrant/parts/hydrant-app/
twillis    477   0.0  0.0  2435120    420 s000  R+    1:05PM   0:00.00 grep pdb
HellooKitty:hydrant twillis$ 

正在发生的事情

C-x [space]

将报告已经确定了一个分点。 但是,我无法设法找到事情。

我认为,我在这里就没有明显的东西。 页: 1

因此,在胚胎中的互动分解是值得的? 交互分解是可能的。 关于我如何开展工作的任何建议?

最佳回答
问题回答

在您的法典中使用pdb.set_trace(<>>/code>,然后不使用您的驾驶证,只字不提你的节目(我想只读/Users/twillis/projects/hydrant/bin/devserver)。 /Users/twillis/projects/hydrant/parts/hydrant-app/ 您应为之工作。 在你称之为pdb.set_trace(trace)的时候,你应当落到夸张的头上,然后从那里可以添加破碎点或所需的任何其他东西。





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...