daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def createGrid(self):
  2.     colour = True
  3.     self.grid_list = []
  4.     for rows in range(8):
  5.         label = Label(self.canvas, text='{}'.format(rows+1), bg='#727272', highlightthickness=0)
  6.         label.grid(row=rows, column=0)
  7.         row_list = []
  8.         self.grid_list.append(row_list)
  9.         colour = not colour
  10.         for columns in range(8):
  11.             label = Label(self.canvas, text='{}'.format(self.letters[columns]), bg='#727272',
  12.                           fg='white', highlightthickness=0, height = 2)
  13.             label.grid(row=8, column=columns+1)
  14.             if colour:
  15.                 grid_piece = Canvas(self.canvas, width=self.size / 8, height=self.size / 8, bg=self.colour1,
  16.                                     highlightthickness=0, highlightbackground='#727272')
  17.                 grid_piece.grid(row=rows, column=columns+1, padx = 0, pady = 0)
  18.             else:
  19.                 grid_piece = Canvas(self.canvas, width=self.size / 8, height=self.size / 8, bg=self.colour2,
  20.                                     highlightthickness = 0)
  21.                 grid_piece.grid(row=rows, column=columns+1)
  22.             colour = not colour
  23.             row_list.append(grid_piece)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top