sandboxing/running python code line by line

后端 未结 7 1320
遥遥无期
遥遥无期 2020-12-14 03:50

I\'d love to be able to do something like these two are doing:

Inventing on principle @18:20 , Live ClojureScript Game Editor

If you don\'t wanna check the v

相关标签:
7条回答
  • 2020-12-14 04:31

    For simple tracing I suggest you use pdb. I've found it's quite reasonable for most debugging/single stepping purposes. For your example:

    import pdb
    ...
    xs = []
    pdb.set_trace()
    for x in xrange(10):
        xs.append(x)
    

    Now your program will stop at the set_trace() call and you can use n or s to step through your code while it's executing. AFAIK pdb is using bdb as its backend.

    0 讨论(0)
提交回复
热议问题