Advertisement
sriyanto

chapter1_01

Dec 28th, 2023 (edited)
519
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. import tkinter as tk
  2.  
  3. class Game(tk.Frame):
  4.     def __init__(self, master):
  5.         super(Game, self).__init__(master)
  6.         self.lives = 3
  7.         self.width = 610
  8.         self.height = 400
  9.         self.canvas = tk.Canvas(self, bg='#aaaaff',
  10.                                 width=self.width,
  11.                                 height=self.height,)
  12.         self.canvas.pack()
  13.         self.pack()
  14.  
  15.  
  16. if __name__ == '__main__':
  17.     root = tk.Tk()
  18.     root.title('Hello, Pong!')
  19.     game = Game(root)
  20.     game.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement