Python Debugger / IDE ??

Discussion in 'Python' started by krypto.wizard@gmail.com, Mar 14, 2006.

  1. Guest

    Is there any editor or IDE in Python (either Windows or Linux) which
    has very good debugging facilites like MS VisualStudio has or something
    like that.

    I like SPE but couldn't easily use winPDP. I need tips to debug my code
    easily.

    Every help is greatly appreciated.

    Thanks
    , Mar 14, 2006
    #1
    1. Advertising

  2. Guest

    wrote:
    > Is there any editor or IDE in Python (either Windows or Linux) which
    > has very good debugging facilites like MS VisualStudio has or something
    > like that.
    >
    > I like SPE but couldn't easily use winPDP. I need tips to debug my code
    > easily.
    >
    > Every help is greatly appreciated.
    >
    > Thanks


    I've always been happy with the debugger in PythonWin. You can even
    use:

    from pywin.debugger import set_trace;set_trace()

    to bring up the debugger directly from a script that wasn't originally
    run in the ide.
    , Mar 14, 2006
    #2
    1. Advertising

  3. Guest

    >Is there any editor or IDE in Python (either Windows or Linux) which
    >has very good debugging facilites like MS VisualStudio has or something
    >like that.


    I've been using Eclipse with PyDev and am very happy with it.
    , Mar 14, 2006
    #3
  4. Rene Pijlman Guest

    Rene Pijlman, Mar 14, 2006
    #4
  5. wrote:
    > Is there any editor or IDE in Python (either Windows or Linux) which
    > has very good debugging facilites like MS VisualStudio has or something
    > like that.
    >
    > I like SPE but couldn't easily use winPDP. I need tips to debug my code
    > easily.
    >
    > Every help is greatly appreciated.
    >
    > Thanks
    >

    If you don't mind spending (not so much) money, ActiveState's Komodo
    is a nice debugger. With it you can even debug a Python program on
    a remote machine over a network connection (ideal for GUI problems).

    --Scott David Daniels
    Scott David Daniels, Mar 14, 2006
    #5
  6. wrote:
    > Is there any editor or IDE in Python (either Windows or Linux) which
    > has very good debugging facilites like MS VisualStudio has or something
    > like that.
    >
    > I like SPE but couldn't easily use winPDP. I need tips to debug my code
    > easily.


    pythonic "debugging" in three steps:

    1/ unit tests
    2/ a bunch of print statements
    3/ the interactive python shell

    All this relying on well-decoupled, modular code.

    FWIW, I've almost never used a debugger with Python.

    HTH
    --
    bruno desthuilliers
    python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
    p in ''.split('@')])"
    bruno at modulix, Mar 14, 2006
    #6
  7. Guest

    My code has got big and it is an iterative program. I use print
    statements but I thought I could get something handy it would be useful
    to me.

    thanks
    , Mar 14, 2006
    #7
  8. Larry Bates Guest

    wrote:
    > Is there any editor or IDE in Python (either Windows or Linux) which
    > has very good debugging facilites like MS VisualStudio has or something
    > like that.
    >
    > I like SPE but couldn't easily use winPDP. I need tips to debug my code
    > easily.
    >
    > Every help is greatly appreciated.
    >
    > Thanks
    >

    I've found that using logging works well for me. I put statements in
    my program that log information, trace, intermediate results, ..., and
    wrap them in trace/debug if statements. Higher values of debug get more
    "stuff" logged. Then I leave everything in the program. When something
    goes wrong, run it with debug level and I can figure out what is
    happening. This is especially good when problem pops up 2 years from
    now. I just have client run with debug=4 and I look at the logfile. If
    you get in a habit of writing ALL your software this way, you find that
    it is quite powerful and easy. I haven't found the overhead of all the
    if statements to be anything to worry about. You can use the standard
    library logging module (I wrote my own before it was available and I've
    never changed to the one in the standard library).

    -Larry Bates
    Larry Bates, Mar 14, 2006
    #8
  9. Em Ter, 2006-03-14 às 09:44 -0800, escreveu:
    > >Is there any editor or IDE in Python (either Windows or Linux) which
    > >has very good debugging facilites like MS VisualStudio has or something
    > >like that.

    >
    > I've been using Eclipse with PyDev and am very happy with it.


    I second that. It's the best Python IDE I've ever used. But you won't
    get too far with less than 512 MiB of RAM...

    --
    "Quem excele em empregar a força militar subjulga os exércitos dos
    outros povos sem travar batalha, toma cidades fortificadas dos outros
    povos sem as atacar e destrói os estados dos outros povos sem lutas
    prolongadas. Deve lutar sob o Céu com o propósito primordial da
    'preservação'. Desse modo suas armas não se embotarão, e os ganhos
    poderão ser preservados. Essa é a estratégia para planejar ofensivas."

    -- Sun Tzu, em "A arte da guerra"
    Felipe Almeida Lessa, Mar 14, 2006
    #9
  10. wrote:
    > I've always been happy with the debugger in PythonWin. You can even
    > use:
    >
    > from pywin.debugger import set_trace;set_trace()
    >
    > to bring up the debugger directly from a script that wasn't originally
    > run in the ide.

    I use that one also.
    There is also Boa (http://boa-constructor.sourceforge.net/), available
    both in Linux and Windows, and with the avantage of having a separate
    process for the debugging unit, which is great when you have to explore
    some unsane scripts.
    Regards
    jm
    jean-michel bain-cornu, Mar 15, 2006
    #10
  11. bruno at modulix wrote:
    > FWIW, I've almost never used a debugger with Python.

    It's pourtant very simpa from time to time !
    jean-michel bain-cornu, Mar 15, 2006
    #11
  12. schrieb:
    > Is there any editor or IDE in Python (either Windows or Linux) which
    > has very good debugging facilites like MS VisualStudio has or something
    > like that.
    >
    > I like SPE but couldn't easily use winPDP. I need tips to debug my code
    > easily.


    You can try out PyScripter, a relatively new Python IDE that is
    completely free and has nice debugging and unit testing facilities.

    The latest version is available here:
    http://mmm-experts.com/Downloads.aspx?ProductID=4&ShowVersionInfo=yes

    -- Christoph
    Christoph Zwerschke, Mar 15, 2006
    #12
  13. Guest

    I like the Pyscripter, is there any Linux version or something of it.
    Christoph Zwerschke wrote:
    > schrieb:
    > > Is there any editor or IDE in Python (either Windows or Linux) which
    > > has very good debugging facilites like MS VisualStudio has or something
    > > like that.
    > >
    > > I like SPE but couldn't easily use winPDP. I need tips to debug my code
    > > easily.

    >
    > You can try out PyScripter, a relatively new Python IDE that is
    > completely free and has nice debugging and unit testing facilities.
    >
    > The latest version is available here:
    > http://mmm-experts.com/Downloads.aspx?ProductID=4&ShowVersionInfo=yes
    >
    > -- Christoph
    , Mar 15, 2006
    #13
  14. wrote:
    > I like the Pyscripter, is there any Linux version or something of it.


    Sorry, I forgot to mention that there is a snag in it. Since PyScripter
    is based on Python for Delphi, it is available for Windows only.

    -- Christoph
    Christoph Zwerschke, Mar 15, 2006
    #14
  15. a écrit :
    > My code has got big


    How big ? More than 50 kloc ?-)

    Big project doesn't imply long functions nor fat classes.

    > and it is an iterative program.


    Sorry, I don't understand what you mean by "iterative" here.
    Bruno Desthuilliers, Mar 16, 2006
    #15
  16. Can you please point some good documents (need not be Python specific)
    on best practices with writing code this way ?

    Thanks,
    Ritesh
    Ritesh Raj Sarraf, Mar 16, 2006
    #16
  17. Don Taylor Guest

    Christoph Zwerschke wrote:
    > wrote:
    >
    >>I like the Pyscripter, is there any Linux version or something of it.

    >
    >
    > Sorry, I forgot to mention that there is a snag in it. Since PyScripter
    > is based on Python for Delphi, it is available for Windows only.
    >


    Is there a free or low-cost version of Delphi for Windows available
    anywhere?

    Pyscripter looks interesting but when I went to the Borland site to find
    out about the cost of Delphi I went into catatonic shock. They can't be
    serious.

    Then I read on Wikipedia that "On February 8th, 2006, Borland announced
    that it was looking for a buyer for its IDE and Database line of
    products, which included Delphi, to concentrate on its Application
    Lifecycle Management line."

    So I guess it is at the end of its life, at least with Borland. Maybe
    they will FOSS it? Nah...

    Don.
    Don Taylor, Mar 16, 2006
    #17
  18. Rowdy Guest

    Don Taylor wrote:
    > Is there a free or low-cost version of Delphi for Windows available
    > anywhere?
    >

    <snip>

    There used to be a Delphi 6 Personal Edition that was available free
    (for non-commercial use). You might still find it around somewhere.

    Rowdy
    Rowdy, Mar 16, 2006
    #18
  19. robert Guest

    Pythonic debugging - Re: Python Debugger / IDE ??

    bruno at modulix wrote:

    > wrote:
    >
    >>Is there any editor or IDE in Python (either Windows or Linux) which
    >>has very good debugging facilites like MS VisualStudio has or something
    >>like that.
    >>
    >>I like SPE but couldn't easily use winPDP. I need tips to debug my code
    >>easily.

    >
    >
    > pythonic "debugging" in three steps:
    >
    > 1/ unit tests
    > 2/ a bunch of print statements
    > 3/ the interactive python shell
    >
    > All this relying on well-decoupled, modular code.
    >
    > FWIW, I've almost never used a debugger with Python.


    Thats a good socket for Python.
    Arduos step-in debugging, big tedious remote debugging sessions etc. are
    not really Pythonic. For complex things like GUI's and application
    servers its a weak practice.

    logs, postmortem debugging and ad-hoc debugging are the things to go next.

    so its good when you can do .pm() .set_trace() to call the debugger
    from the nature of your program. (And not: "The the debugger now calls
    the app, once my level of anger raised beyond a certain limit").

    For example with callable debuggers like pdb and also Pythonwin
    (Pythonwin debugger "pywin.debugger.pm()" e.g. can be raised as simple
    from normal apps / shell ) I simply do this in apps regularly:

    if debug: sys.excepthook = excepthook_my_debugger

    As soon as stuff crashes down (even in GUI message handlers) during all
    of the development cycle: you have your fingers and cursor automatically
    & immediatly at the stack context. That does >99% of usual python code
    cooking. The rest is maybe for a (slow) breakpoint "b"

    Unfortunately such method is not encouraged and exposed (clearly) in the
    big IDE's. Those' overall style is a lazy copy of C, Java "I do"-hacker
    history. Im curious much about their value at all. Keep it simple and
    let Python do.

    Robert
    robert, Mar 17, 2006
    #19
  20. Don Taylor wrote:
    > Is there a free or low-cost version of Delphi for Windows available
    > anywhere?


    I don't know (never used Delphi actually). Anyway, you don't need to
    have Delphi to use PyScripter, and PyScripter is completely free.
    However, it will only run on Windows because it is developed with
    Delphi. The advantage is that it is noticeably faster than most other
    free Python IDEs written in Python.

    -- Christoph
    Christoph Zwerschke, Mar 29, 2006
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    900
    Axel Straschil
    Apr 6, 2005
  2. SPE - Stani's Python Editor
    Replies:
    0
    Views:
    384
    SPE - Stani's Python Editor
    Nov 2, 2005
  3. Wingware
    Replies:
    0
    Views:
    229
    Wingware
    Jun 16, 2010
  4. Robert Oschler
    Replies:
    1
    Views:
    214
    Mcginkel
    Sep 5, 2005
  5. aflat362
    Replies:
    7
    Views:
    212
    naixn
    Dec 7, 2006
Loading...

Share This Page