Persistence and systematic problem solving required for programmers


The code below was expected to generate the above example of using an image as background to a window. It didn’t. And after a couple of hours I only just got it working. The problem was largely the development environment (Pyscripter). It reminded me that students cutting code need both persistence and the patience required to follow a systematic problem solving process. These are challenging behaviors and skills for young people to acquire…

from tkinter import *
class GUI:
def __init__(self):
window = Tk()
window.title(“image test”)
window.minsize(width=600, height=400)
self.background_image= PhotoImage(file=”board.gif”)
self.background_label = Label(window, image=self.background_image), y=0, relwidth=1, relheight=1)

heading_label = Label(window, bg=”black”, fg=”red”, text=”Classes”, font=(“Times”,”24″))

name_label = Label(window, text=’Enter Name:’)
self.name_field = Entry(window)

#initialises the programme

This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s