[Tutor] Python Debugger shortcut to go to the last frame
Hi Please consider the following script: #!/usr/bin/env python3.6 #pdb_last_frame.py import pdb def recursive_function(n=5, output='default print'): if n > 0: recursive_function(n - 1) else: pdb.set_trace() print(output) return if __name__ == '__main__': recursive_function("space ham") For instance we run it as python3.6 -m pdb pdb_last_frame.py The following command sequence applied once the script stopped on bp: u u The question is there any command to go directly to the last frame instead of typing d d ? Thank you in advance. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python debugger/IDE that can be launched from a remote command line
On Fri, May 10, 2013 at 10:58 AM, Michael O'Leary wrote: > I am working on a project in which the code and data I am working with are > all on an Amazon EC2 machine. So far I have been ssh'ing to the EC2 machine > in two terminal windows, running emacs or vi in one of them to view and > update the code and running the "python -m pdb ..." debugger in the other > one to step through the code. > > I would prefer to work with an IDE that displays and updates program state > automatically, but I don't know which ones I could launch from a remote > machine and have it display within a terminal window or use XWindows or GTK > to display in its own window. Are there any Python debuggers or IDEs that > can be used in this kind of setting? > Thanks, > Mike > > I think IPython could be a useful here. Kick start a IPython notebook on Amazon machine and open it over https locally. More information on this here http://ipython.org/ipython-doc/dev/interactive/htmlnotebook.html -Abhi > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > > ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] Python debugger/IDE that can be launched from a remote command line
I am working on a project in which the code and data I am working with are all on an Amazon EC2 machine. So far I have been ssh'ing to the EC2 machine in two terminal windows, running emacs or vi in one of them to view and update the code and running the "python -m pdb ..." debugger in the other one to step through the code. I would prefer to work with an IDE that displays and updates program state automatically, but I don't know which ones I could launch from a remote machine and have it display within a terminal window or use XWindows or GTK to display in its own window. Are there any Python debuggers or IDEs that can be used in this kind of setting? Thanks, Mike ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python debugger
On Sat, Jan 10, 2009 at 7:37 AM, jadrifter wrote: > Despite the name I believe Winpdb is platform independent Yes, it is, it is windows as in GUI not windows as in Microsoft. Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python debugger
Despite the name I believe Winpdb is platform independent I haven't used it myself but I looked into it while following this thread. http://winpdb.org/ John Purser On Sat, 2009-01-10 at 12:56 +0100, Michael Bernhard Arp Sørensen wrote: > It might and I'll keep it in mind. > > However, I'm not going to ditch my linux just to get a gui debugger. > After all, I do have WingIDE installed in Linux, but I wanted to be > free of the GUI limitations I have when I code on a host that I > connect to through a minicom on another ssh host. I do that from time > to time. > > Thanks anyway. I got what I needed. :-) > > /Michael > > On Fri, Jan 9, 2009 at 3:14 PM, Kent Johnson wrote: > On Fri, Jan 9, 2009 at 7:36 AM, Michael Bernhard Arp Sørensen > wrote: > > > I can't use a graphical debugger because i mostly code > python over ssh on > > remote servers in my company. > > > Winpdb opens a socket connection between the debugger and > debuggee. > Perhaps it would run over an ssh tunnel... > > Kent > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python debugger
It might and I'll keep it in mind. However, I'm not going to ditch my linux just to get a gui debugger. After all, I do have WingIDE installed in Linux, but I wanted to be free of the GUI limitations I have when I code on a host that I connect to through a minicom on another ssh host. I do that from time to time. Thanks anyway. I got what I needed. :-) /Michael On Fri, Jan 9, 2009 at 3:14 PM, Kent Johnson wrote: > On Fri, Jan 9, 2009 at 7:36 AM, Michael Bernhard Arp Sørensen > wrote: > > > I can't use a graphical debugger because i mostly code python over ssh on > > remote servers in my company. > > Winpdb opens a socket connection between the debugger and debuggee. > Perhaps it would run over an ssh tunnel... > > Kent > ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python debugger
On Fri, Jan 9, 2009 at 7:36 AM, Michael Bernhard Arp Sørensen wrote: > I can't use a graphical debugger because i mostly code python over ssh on > remote servers in my company. Winpdb opens a socket connection between the debugger and debuggee. Perhaps it would run over an ssh tunnel... Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python debugger
Hi. Thanks for the input. Your way of doing it is simpler and possible to use as an alias in pdb. I can't use a graphical debugger because i mostly code python over ssh on remote servers in my company. Thanks anyway. It was actually helpfull. :-) /Michael On Fri, Jan 9, 2009 at 12:38 PM, Kent Johnson wrote: > On Fri, Jan 9, 2009 at 3:27 AM, Michael Bernhard Arp Sørensen > wrote: > > Hi there. > > > > I've just started using the python debugger and I wonder how I could have > > lived without it earlier. > > > > I just wonder if there is a smarter way to show what all the variables > > contain in any given point in the debugger. I'm using this approach: > > > > import sys > > f = sys._getframe() > > p f.f_locals.items() > > > > It's not exacly pretty in its output, but it's better than nothing. Can > this > > be done in a smarter way? > > 'a' will show the arguments to the current function; not the same but > shorter. > p locals().items() is probably the same as what you are doing. > > You might want to look at a graphical debugger such as winpdb. > > Kent > ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python debugger
On Fri, Jan 9, 2009 at 3:27 AM, Michael Bernhard Arp Sørensen wrote: > Hi there. > > I've just started using the python debugger and I wonder how I could have > lived without it earlier. > > I just wonder if there is a smarter way to show what all the variables > contain in any given point in the debugger. I'm using this approach: > > import sys > f = sys._getframe() > p f.f_locals.items() > > It's not exacly pretty in its output, but it's better than nothing. Can this > be done in a smarter way? 'a' will show the arguments to the current function; not the same but shorter. p locals().items() is probably the same as what you are doing. You might want to look at a graphical debugger such as winpdb. Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Python debugger
Hi there. I've just started using the python debugger and I wonder how I could have lived without it earlier. I just wonder if there is a smarter way to show what all the variables contain in any given point in the debugger. I'm using this approach: import sys f = sys._getframe() p f.f_locals.items() It's not exacly pretty in its output, but it's better than nothing. Can this be done in a smarter way? -- Kind regards Michael B. Arp Sørensen Programmer / BOFH "Ride out and meet them." ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] python debugger
> I have a small problem with python's debugger. > I don't know how can I debugg a script through this debugger. > Can you tell me? There are several debuggers available on top of the basic pdb module. If you know the Gnu debugger gdb then pdb is closely modelled on that. If you don't know gdb you are probably better off with a graphical interface such as the debuggers in IDLE or Pythonwin. If you really want to learn how to use pdb let us know and we can talk you through it - not a bad thing since text based debuggers are potentially powerful testing tools. But I'd try the graphical tools first. If the IDLE/Pyhtonwin debuggers still don't make sense tell us specifically what the issues are and we can tryu to help there too. OTOH if it is debugging in general that you are having difficulty with then its very possible you never bneed to start a debugger tool, simple test strategies can often be more effective. Alan g. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] python debugger
Hi, guys,I have a small problem with python's debugger. I don't know how can I debugg a script through this debugger.Can you tell me?Thank you very much___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python debugger bummer
Thanks Alan. As always, you are very helpful. Victor On Mon, 2006-01-16 at 23:35 +, Alan Gauld wrote: > > I was going through the Python library documentation and I found > > something I never saw before. > > > > $ python -m pdb myscript.py > > I was just about to suggest loading pdb... > > And of course there is also a graphical debugger in IDLE as > well as PythonWin. > > The paper version of my book contains a chapter > (not on the web site) on how to use pdb to debug a script. > pdb has its limitations but if you are used to gdb then its > not too bad. > > (pdb) help > > is your friend. > > Alan G > Author of the learn to program web tutor > http://www.freenetpages.co.uk/hp/alan.gauld > > ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python debugger bummer
> I was going through the Python library documentation and I found > something I never saw before. > > $ python -m pdb myscript.py I was just about to suggest loading pdb... And of course there is also a graphical debugger in IDLE as well as PythonWin. The paper version of my book contains a chapter (not on the web site) on how to use pdb to debug a script. pdb has its limitations but if you are used to gdb then its not too bad. (pdb) help is your friend. Alan G Author of the learn to program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python debugger bummer
Hi again, I was going through the Python library documentation and I found something I never saw before. $ python -m pdb myscript.py This is what I was looking for! Great help. Any further reference could of course help a lot. I never was able to get the hang of it until now. Victor On Mon, 2006-01-16 at 13:12 -0600, Victor Bouffier wrote: > Hi to all, > > I tried to look for a reference to this issue in the ASPN archive, but I > can't seem to find an answer. > > I currently work under Linux and have never been able to properly use > the Python debugger. Coming from a Perl background, I fail to find a > similar simple way to step through my code the way I am able to do it > through the -d flag using Perl on the command line. It is so painless. > > I have used Python on Windows, usually writing my programs using Vim, > and entering the PythonWin environment to debug my programs. It is a > good environment to do that, although I prefer my independent editor for > writing my programs. > > I once paid for ActiveState's Komodo for Linux to use as an IDE, but I find it > bloated and slow, not to mention the need to constantly upgrade if you > want to keep up with versions (have not done it yet). > > Does anyone have any suggestions as to an alternative to PythonWin, or > even better still, a reference to a good tutorial on how to use my > current tools: how to use the python debugger as the way Perl debugger > works? I am certain the Python interpreter (being better that Perl in > that sense) must have a way to use the debugger. > > I work under Linux using vi/gvim and ipython (I have never really tried > IDLE). > > Thanks in advance for any help. > Victor > > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Python debugger bummer
Hi to all, I tried to look for a reference to this issue in the ASPN archive, but I can't seem to find an answer. I currently work under Linux and have never been able to properly use the Python debugger. Coming from a Perl background, I fail to find a similar simple way to step through my code the way I am able to do it through the -d flag using Perl on the command line. It is so painless. I have used Python on Windows, usually writing my programs using Vim, and entering the PythonWin environment to debug my programs. It is a good environment to do that, although I prefer my independent editor for writing my programs. I once paid for ActiveState's Komodo for Linux to use as an IDE, but I find it bloated and slow, not to mention the need to constantly upgrade if you want to keep up with versions (have not done it yet). Does anyone have any suggestions as to an alternative to PythonWin, or even better still, a reference to a good tutorial on how to use my current tools: how to use the python debugger as the way Perl debugger works? I am certain the Python interpreter (being better that Perl in that sense) must have a way to use the debugger. I work under Linux using vi/gvim and ipython (I have never really tried IDLE). Thanks in advance for any help. Victor ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python debugger under Tiger?
Great recommendation, thanks.-MHOn May 18, 2005, at 8:12 PM, Lee Cullens wrote:Mike,You may not be looking for a commercial IDE, but I am very happy with WingIDE and using it with Tiger.Lee COn May 18, 2005, at 6:54 PM, Mike Hall wrote: I should of specified that I'm looking for an IDE with fulldebugging. Basically something like Xcode, but with Python support.On May 18, 2005, at 3:10 PM, [EMAIL PROTECTED] wrote: Quoting Mike Hall <[EMAIL PROTECTED]>: Does anyone know of a Python debugger that will run under OSX 10.4?The Eric debugger was looked at, but it's highly unstable underTiger. Thanks. pdb should work :-)-- John.___Tutor maillist - Tutor@python.orghttp://mail.python.org/mailman/listinfo/tutor ___Tutor maillist - Tutor@python.orghttp://mail.python.org/mailman/listinfo/tutor ___Tutor maillist - Tutor@python.orghttp://mail.python.org/mailman/listinfo/tutor___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Python debugger under Tiger?
> Subject: > Re: [Tutor] Python debugger under Tiger? > From: > Mike Hall <[EMAIL PROTECTED]> > Date: > Wed, 18 May 2005 15:54:18 -0700 > To: > [EMAIL PROTECTED] > > To: > [EMAIL PROTECTED] > CC: > tutor@python.org > > > I should of specified that I'm looking for an IDE with full debugging. > Basically something like Xcode, but with Python support. > > > On May 18, 2005, at 3:10 PM, [EMAIL PROTECTED] wrote: > >> Quoting Mike Hall <[EMAIL PROTECTED]>: >> >> >>> Does anyone know of a Python debugger that will run under OSX 10.4? >>> The Eric debugger was looked at, but it's highly unstable under >>> Tiger. Thanks. >>> >> >> pdb should work :-) >> >> -- >> John. >> ___ >> Tutor maillist - Tutor@python.org >> http://mail.python.org/mailman/listinfo/tutor >> It's too bad that Activestate doesn't have a version of Komodo that runs under OS X. They have Windows, Linux, and Solaris, but not OS X. I wonder if Eclipse using PyDev has visual debugging/stepping/watching that you are looking for? You might want to ask on the python mac mail list http://mail.python.org/mailman/listinfo/pythonmac-sig Mike ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python debugger under Tiger?
> Does anyone know of a Python debugger that will run under OSX 10.4? > The Eric debugger was looked at, but it's highly unstable under > Tiger. Thanks. pdb should still work. Alan g ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python debugger under Tiger?
Mike, You may not be looking for a commercial IDE, but I am very happy with WingIDE and using it with Tiger. Lee C On May 18, 2005, at 6:54 PM, Mike Hall wrote: > I should of specified that I'm looking for an IDE with full > debugging. Basically something like Xcode, but with Python support. > > > On May 18, 2005, at 3:10 PM, [EMAIL PROTECTED] wrote: > > >> Quoting Mike Hall <[EMAIL PROTECTED]>: >> >> >> >>> Does anyone know of a Python debugger that will run under OSX 10.4? >>> The Eric debugger was looked at, but it's highly unstable under >>> Tiger. Thanks. >>> >>> >> >> pdb should work :-) >> >> -- >> John. >> ___ >> Tutor maillist - Tutor@python.org >> http://mail.python.org/mailman/listinfo/tutor >> >> > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python debugger under Tiger?
I should of specified that I'm looking for an IDE with full debugging. Basically something like Xcode, but with Python support. On May 18, 2005, at 3:10 PM, [EMAIL PROTECTED] wrote: > Quoting Mike Hall <[EMAIL PROTECTED]>: > > >> Does anyone know of a Python debugger that will run under OSX 10.4? >> The Eric debugger was looked at, but it's highly unstable under >> Tiger. Thanks. >> > > pdb should work :-) > > -- > John. > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python debugger under Tiger?
Quoting Mike Hall <[EMAIL PROTECTED]>: > Does anyone know of a Python debugger that will run under OSX 10.4? > The Eric debugger was looked at, but it's highly unstable under > Tiger. Thanks. pdb should work :-) -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Python debugger under Tiger?
Does anyone know of a Python debugger that will run under OSX 10.4? The Eric debugger was looked at, but it's highly unstable under Tiger. Thanks.-MH___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor