0% found this document useful (0 votes)
7 views1 page

Meme2.Py (Cont.) Python 3

Uploaded by

Caner Topko
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Meme2.Py (Cont.) Python 3

Uploaded by

Caner Topko
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

meme2.py (cont.

) / Python 3

# App -------------------

app = App("meme")

top_text = TextBox(app, "top text", command=draw_meme)


bottom_text = TextBox(app, "bottom text", command=draw_meme)

meme = Drawing(app, width="fill", height="fill")

draw_meme()

app.display()

meme3.py / Python 3
# Imports ---------------

from guizero import App, TextBox, Drawing

# Functions -------------

def draw_meme():
meme.clear()
meme.image(0, 0, "woodpecker.png")
meme.text(
20, 20, top_text.value,
color="orange",
size=40,
font="courier")
meme.text(
20, 320, bottom_text.value,
color="blue",
size=28,
font="times new roman",
)

32 CREATE GRAPHICAL USER INTERFACES WITH PYTHON

You might also like