In this video, learn how to set breakpoints in order to step through and debug your code. Setting breakpoints is a great way to understand the flow of your code, especially when using object-oriented programming with inheritance.
- [Narrator] Hello, and welcome to Python Projects.…In this video, we will be setting breakpoints…in order to debug our code and understand it better.…First, we define a class, PythonProjects.…Down here, we create an instance of the class,…and what's in the class is init method.…We call the print message method,…and we now run it.…It'll print out the print statement…we passed in to the Python console.…
Next, we add a second class to our module,…and within the first class,…we create an instance of the Utilities class,…and on this instance, recall the print message…was timestamp method and within this method,…we are adding today, and today we got by importing…the datetime module, calling now on it…and then formatting the string time…for year, month, and day.…We may now execute the program.…We get our original message, and we get the second message,…which we called over here, which has the at sign,…plus today's date added to it.…
Next, we're going to use inheritance.…So, in our second class on the Utilities class,…
Note: This course was created by Packt Publishing. We are pleased to host this training in our library.
- Running Python programs within Eclipse
- Setting breakpoints
- Using the PyDev debugger
- Using design patterns
- Creating a GUI application with Tkinter
- Writing a Windows scheduling service