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
Q: Why can't I access the Lake Pend Orielle site (http://lpo.dt.navy.mil)?
A: The Lake Pend Orielle site is not accessible in some geographical areas. We have contacted the owner of the server to try to resolve this issue.
Q: I am unable to access the Lake Pend Oreille data from outside the U.S.
A: A static copy of this data is provided here for lynda.com members outside of the U.S