Git Product home page Git Product logo

epdb's Introduction

Overview

Adds functionality to the python debugger, including support for remote debugging

Installation

pip install epdb

Usage

For debugging code locally, epdb generally works the same as pdb. You can debug a program from the python interpreter:

>>> import epdb
>>> import mymodule
>>> epdb.Epdb().run('mymodule.test()')
*** NameError: name 'execfile' is not defined
> /home/wasche/git/epdb/<string>(1)<module>()
-> """
(Epdb) continue
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/lib64/python3.5/bdb.py", line 431, in run
    exec(cmd, globals, locals)
  File "<string>", line 1, in <module>
  File "/home/wasche/git/epdb/mymodule.py", line 2, in test
    import spam
ImportError: No module named 'spam'

You can also drop breakpoints at specific places in a program's code by inserting:

import epdb; epdb.set_trace()

or by using the alias st:

import epdb; epdb.st()

To debug code that is either running on a remote system, or in a process that isn't attached to your tty you can use epdb in server mode:

import epdb; epdb.serve()

By default epdb.serve() will start a simple telnet server on port 8080, but you can use the port keyword argument to use a different port:

import epdb; epdb.serve(port=8888)

You can connect to the epdb server by using epdb.connect():

>>> import epdb
>>> epdb.connect()

By default epdb.connect() will attempt to connect to port 8080 on localhost. If you are debugging a process on another host or port, you can call connect with the host or port keyword arguments:

>>> import epdb
>>> epdb.connect(host='some.host.com', port=8888)

Known Issues

  • epdb.serve() does not work with python 2.7.5 [#7]

epdb's People

Contributors

elliotpeele avatar mtharp avatar mibanescu avatar xbcsmith avatar wfscheper avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.