April 2018
Beginner
340 pages
7h 54m
English
To make and display a window for our game, we just need an instance of our GameScreen. Since this inherits from the Tk widget, we will also need to call its mainloop method to make it show.
We will do this within an if __name__ == "__main__" block to allow our classes from this file to be imported into another, in case someone wanted to write another card game using our Card and Deck classes, for example:
if __name__ == "__main__": gs = GameScreen() gs.mainloop()
Add the preceding code to the very bottom of your code file of this chapter and run the program. You should now have a fully working game of blackjack:
