@FrankZhang6/

tkinter proj

Tkinter

No description

fork
loading
Files
  • main.py
  • nohup.out
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from tkinter import *

def write(canvas, txt, x, y):
  canvas.create_text(x, y, text = txt)


class Struct(object): pass
ansBank = Struct()
data = Struct()

def init(data):
  data.width = 800
  data.height = 600
  pass


def startup(canvas, data):
  createBackground(canvas, data)
  pass
  
def createBackground(canvas, data):
  canvas.create_rectangle(0, 0, data.width, data.height, fill='skyblue3')

def main():
    init(data)
    root = Tk()
    canvas = Canvas(root, width=data.width, height=data.height)
    canvas.pack()
    startup(canvas, data)
    root.mainloop()

main()