Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Where did you put <code>pdb.set_trace()</code>...? This works for me:</p> <pre><code>#!/usr/bin/python # -*- coding: utf-8 -*- import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web import pdb from tornado.options import define, options define("port", default=8000, help="run on the given port", type=int) class IndexHandler(tornado.web.RequestHandler): def get(self): greeting = self.get_argument('greeting', 'Hello') reself.write(greeting + ', friendly user!') if __name__ == "__main__": tornado.options.parse_command_line() app = tornado.web.Application(handlers=[(r"/", IndexHandler)]) http_server = tornado.httpserver.HTTPServer(app) http_server.listen(options.port) pdb.set_trace() tornado.ioloop.IOLoop.instance().start() </code></pre> <p>Session:</p> <pre><code>$ python test.py &gt; /home/mariusz/Dokumenty/Projekty/Testy/test.py(24)&lt;module&gt;() -&gt; tornado.ioloop.IOLoop.instance().start() (Pdb) break 16 Breakpoint 1 at /home/mariusz/Dokumenty/Projekty/Testy/test.py:16 (Pdb) continue &gt; /home/mariusz/Dokumenty/Projekty/Testy/test.py(16)get() -&gt; self.write(greeting + ', friendly user!') (Pdb) step --Call-- &gt; /usr/local/lib/python2.7/dist-packages/tornado/web.py(497)write() -&gt; def write(self, chunk): (Pdb) step &gt; /usr/local/lib/python2.7/dist-packages/tornado/web.py(512)write() -&gt; if self._finished: (Pdb) step &gt; /usr/local/lib/python2.7/dist-packages/tornado/web.py(516)write() -&gt; if isinstance(chunk, dict): (Pdb) </code></pre> <p>After putting <code>continue</code> in above code debugger stopped, because I had to poll <code>http://localhost:8000/</code> in browser to have <code>RequestHandler</code> function actually called.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload