Join Club ShowMeDo to Learn Python!

This series is a part of Club ShowMeDo. Click to learn why you should join our club with a simple monthly subscription.

  • We teach Python and all the cool modules
  • Topics include beginner Python, GUIs, Web and Desktop Apps
  • Long, specially crafted video tutorials just for you
  • Club video tutorials extend our normal Free content
  • Save your time - we've done the research for you
  • Keep your skills up-to-date
  • Learn at your own pace, everything you need is shown to you
  • Over 12 hours of archived material are waiting for you in the club

Name: [002] Ian Ozsvald
Member: 109 months
Authored: 181 videos
Description: I am the co-founder of ShowMeDo (see http://showmedo.com/about), author of `The Screencasting Handbook <http://thescreencastinghandbook.com>`_ and the founder of the professional screencast production company `ProCasts <http://procasts.co.uk>`_: .. image:: http://procasts.co.uk/media/procasts_sma ...

Interactive debugging using PyDev [ID:142] (8/10)

in series: Python Development on XP

(Showmedo is undergoing major changes. To report any problems viewing the videos please email us and include browser and OS specifics. Cheers - Kyran.)

Debugging skills are key to making your programs work properly. Here I show you how to step through our previous numbers.py in PyDev's graphical debugger, watching how the variables are created and changed, seeing how the stack changes and using breakpoints for control.

When debugging we need PyDev's debug-perspective, we launch using F11 and then Step Into and Over lines of code and watch how things evolve on the stack and variable list (hint: their colour changes). At the end of the video I show you how to switch back to the normal editing perspective from the debug perspective.

By the end of the video you'll be comfortable with PyDev's debugger and you will be able to step into and around your own code. This will give you more power in understanding how your program is running and what's going on 'under the hood'.

I mention the Change Value/Set Value menu option in the video (when debugging, in the Variables tab) - I have confirmed with Fabio (the author) that this feature is not implemented in the current version of PyDev (let Fabio know that you saw it here and ask for it to be supported!)

For more on debugging with Python (using the stock pdb, not PyDev) see Interactive Debugging in Python by Jeremy Jones.

To talk to your fellow Pythonistas you should join the ShowMeDo Learners Google Group.

Got any questions?

Get answers in the ShowMeDo Learners Google Group.

Video statistics:

  • Video's rank shown in the most popular listing
  • Video plays: 247 (since July 30th)
  • Plays in last week: 0
  • Published: Sometime before 1st March 2007 (in other words - we don't remember!)

Thank-yous, questions and comments

If this video tutorial was helpful please take some time to say thank-you to the authors for their hard work. Feel free to ask questions. Let the author know why their video tutorial was useful - what are you learning about? Did the video tutorial save you time? Would you like to see more?

You may also want to see our ShowMeDo Google Group to speak to our active users and authors.

Your email address will not be published.

Show some quick comments >>








All comments excluding tick-boxed quick-comments

Hi, thanks for all good explanations. :-)

However, I can't find the code examples you are referring to in the end of the video. Please supply a link.


Excellent series, I have already learned a great deal and just getting started. Years ago I attempted to learn Python from a book, but progress was slow, and Python was not a requirement for my job, so it was put on the back burner. This past week I was speaking with a friend about how he learns programming languages and he suggested some of the sites he uses, (non-Python related). After doing some browsing, I decided to see what may be available for Python and stumbled upon your training videos. I was hooked by the second video. Of the videos I have seen, yours are more professional in appearance, focused, and to the point.

While I thought the book I was using was good, your videos show much more with regards to using the tools and other useful links. For instance the book I used , circa 2006, the index referenced ‘debugging’ for less than 10 pages, with no mention of PyDev or the Eclipse editor. In fact it states the 'string format operator' is a useful debugging tool, while that may be true, what I have just learned in this video is far superior.

Thank you.


I haven't used / seen a debugger. That was informative. Thanks.


Excellent job with this! The debugger really show's how things work in an interesting way.


Great video, love Eclipse it is really is a friendly environment to work in :- )


Review of Interactive debugging using PyDev

I seen somewhere that there are more debugging options (e.g. break when a value or expression is a certain value) available in Eclipse. Also, I believe, that you can write statements in the display window but I don't know how to do this.

It would have been nice if you had covered debugging in greater depth as it would have saved me a lot of time.


Review of Interactive debugging using PyDev

I'm new to both Python and debugging and your video has saved me a lot of time and effort.

Thank you!


This was great. I think you'd be surprised how many people don't really know how to use an IDE. I'm one of them. They're pretty intimidating to try and teach yourself...there's lots of buttons and widgets and windows. I've written 1000's of lines of C++ code, but unfortunately I was stuck using a text editor and a compiler. Eclipse could have helped me out greatly if I could have figured out how to use it. This will certainly help me a lot!


Thanks man! Helping me learn more about coding in python swiftly.

:)


I learned a lot in this module. I am a real newbie to python (my previous programming was in Commodore Basic about 30 years ago), so graphical debugging tools seem like magic to me. I am enjoying the vids, but I think I need to do some practical programming to learn the techniques.

I would like to see a series that makes a practical application (like a check register that automatically balances the account, or something like that) from start to finish, demonstrating different techniques, error trapping, etc.


Really really useful! I have been coding PHP for 5 years and have never used a graphical debugger so this was gold dust to me! Many thanks this will make my life so much easier.

As an introduction it was great and very easy to understand, I would love some more tips on this.


great to see Pydev debugger in action.


Hi Richard - thanks for the detailed message. Fabio seems to have introduced this new dependency. Currently PyDev is at 1.3.14 and I recorded these with PyDev 1.2.5 over a year ago.

This fix is easy to implement and it won't stop anyone from using PyDev - the addition of psyco is optional.

Cheers,

Ian.


If you are using the latest version of PyDev you will be getting to messages when starting the debugger:

when using the debug in PyDev I am not getting

exactly the message I am suppose to receive, here is the message :

pydev debugger: warning: psyco not available for debugger speedups

pydev debugger: starting

psyco can now be used by PyDev, it is improving the speed.

See link :

http://pydev.blogspot.com/2008/02/pydev-debugger-and-psyco-speedups.html

You can alose download psyco (with a window installer) at the following link :

http://psyco.sourceforge.net/download.html

After being installed it will remove the warning.


When defining the method it does ask you to confirm where to put it : at the beginning, etc.

Also it is showing you the changes it will be performing.

Great tuto.

Richard


thanks it is great helps


Good episode. Always good to have a nice, debugger. Certainly quicker than manual print stmts; I haven't used pdb, but this looks much more fun. Though I'll have to play with pydev to get over feeling nervous that I'll screw something up. But Ian nicely pointed out many things in the environment which can be safely ignored at this point.

Oh, re. whether or not pressing F11 immediately executes...apparently when Console window has focus, this occurs. When editor window has focus, F11 or run brings up selection list where you must choose python run.


Another very informative and well structured episode which I particularly enjoyed.

As debugging is a type of fault finding and rectification it really helps develop a thorough understanding of whats going on.

Fantastic, I think I'm addicted!


Miracle's syntax change worked for me for changing the values of integers, strings, and lists with one member, but not for lists with more than one member.


Cool, thanks for telling me that. Fabio (PyDev's author) had told me that he had fixed the change-variable feature but I didn't know about the new syntax.

It is so good to hear that you find the entire set to be so helpful :-) I find this really encouraging and it makes me keen to work on my next series!

Ian.


Again, great episode of using Eclipse+Pydev.

The change variable feature works in the latest Eclipse(3.2.2)+Pydev(1.2.9). There is trick though: the default display is "list: [12,123,42]", you have to change it to "[12,123,42]" or other values in this format. This will work. Same for "int: 3" -> "3"

Great work! totally gets me hooked...


Showmedo is a peer-produced video-tutorials and screencasts site for free and open-source software (FOSS)- with the exception of some club videos, the large majority are free to watch and download.

how to help » about » faq »

Educating the Open-source Community With Showmedo

Although as important as the software it supports, education and documentation are relatively neglected in the Open-source world. Coders love to code, and explaining how best to use or improve the software tends to be deferred or even sidelined.

At Showmedo we believe the community can play a vital role here and also say thanks for the tools and software that make our lives easier. If you have a piece of software you love or a programming langugage you are enthusiastic about, why not make a screencast showing others how to use it? All the stuff you wish you'd been told, the tips, tricks, insights that would have saved you time and frustration.

Screencasting is easier than you think, and we're happy to help you. You can emailus for advice or just use some of the how-to screencasts on the site. This screencasting learning-pathis a good place to start.

Kudos and Thanks for Ian

Content

Feedback

Showmedo's development is fairly rapid and bugs will inevitably creep in. If you have any problems please drop us a line using the contact address below. Likewise, any suggestions for improvements to the site are gratefully received.

feedback@showmedo.com