Join Barron Stone for an in-depth discussion in this video Displaying the solutions, part of Code Clinic: Python.
In this video I'll walk you through the parts of…the code that generate the user interface and…draw the board, which is actually most of the code.…I imported the Tkinter package as well as the…themed Tkinter module and the Tk messagebox…module at the top of the code.…Like most of my Tkinter applications I've structured…the n-queens programs as a class.…The class's constructor init method takes one input,…which is the top-level Tk window…object on which to build the GUI.…That top-level window object gets created down…in the main function which is called by this if…statement when the script is run as the main program.…
And it passes that Tk object to the n-queens…constructor method to generate the GUI.…Now let's start digging through the…code by looking at that init method.…It begins by configuring a few class variables,…including the number of queens, the locations…of the queens, the index of the currently displayed…solution and by creating a list of solutions,…which is currently set to none here.…The next section of code configures some important…
Barron introduce challenges and provides an overview of his solutions in Python. Challenges include topics such as statistical analysis, searching directories for images, and accessing peripheral devices.
Visit other courses in the series to see how to solve the exact same challenges in languages like C#, C++, Java, PHP, and Ruby.
Skill Level Intermediate
Problem One: Exploring Lake Pend Oreille
Problem Two: Image Analysis
Problem Three: Eight Queens
Problem Four: Accessing Peripherals
Problem Five: Recursion and Directories
Problem Six: Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.