Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- from tkinter import *
- from number_generator import numgen
- from coordinate_generator import pathfinding
- numbers = numgen()
- path = pathfinding()
- class Application(Frame):
- def __init__(self, master):
- super(Application, self).__init__(master)
- self.grid()
- self.create_widget()
- def create_widget(self):
- for x in range(11):
- for y in range(11):
- self.bttn = Button(self)
- for c in range(len(numbers)):
- if x == path[c][0] and y == path[c][1]:
- self.bttn["text"] = numbers[c]
- self.bttn["bg"] = "blue"
- else:
- self.bttn["text"] = randint(0,200)
- self.bttn.grid(row=x, column=y)
Advertisement
Add Comment
Please, Sign In to add comment