[go: up one dir, main page]

0% found this document useful (0 votes)
88 views3 pages

Meme Code

This Python code allows a user to generate memes by selecting from different meme templates (amazed cat, innocent dragon, etc.). It imports the turtle module and gets user input for which meme template to use. Based on the selection, it sets up variables like image location, text positions and fonts. It then gets text input from the user and writes the text on the image in different positions and colors to create the meme.

Uploaded by

api-401087475
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views3 pages

Meme Code

This Python code allows a user to generate memes by selecting from different meme templates (amazed cat, innocent dragon, etc.). It imports the turtle module and gets user input for which meme template to use. Based on the selection, it sets up variables like image location, text positions and fonts. It then gets text input from the user and writes the text on the image in different positions and colors to create the meme.

Uploaded by

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

import turtle

turtle.hideturtle()

num = turtle.numinput(title="Meme Generator: ", prompt="What Meme Do You Want?:\n1:


Amazed Cat\n2: Innocent Dragon\n3: Blend in\n4: Run Hamster!\n5: Surprised Kid")

y = 0
y2 = 0
f = 0
f2 = 0
y3 = 0
f3 = 0
x3 = 0
fontT = "Tent"
#__________________________________________________________________________________
______________________

if num == 1:
turtle.bgpic("cat.gif")
turtle.setup(width=480, height=360)
turtle.color("White")
turtle.penup()

y = 135
y2 = -145
f = 17
f2 = 15
x3 = 230
y3 = -170
f3 = 15
fontT = "Impact"

#__________________________________________________________________________________
______________________

elif num == 2:
turtle.bgpic("dragon.gif")
turtle.setup(width=763, height=583)
turtle.color("White")
turtle.penup()

y = 240
y2 = -250
f = 17
f2 = 17
x3 = 370
y3 = -280
f3 = 20
fonT = "Adobe Gothic Std B"

#__________________________________________________________________________________
________________

elif num == 3:
turtle.bgpic("Flamingo.gif")
turtle.setup(width=626, height=735)
turtle.color("White")
turtle.penup()

y = 300
y2 = -290
f = 14
f2 = 23
x3 = 300
y3 = -350
f3 = 20
fontT = "Arial Black"

#__________________________________________________________________________________
________________________________

elif num == 4:
turtle.bgpic("hamster.gif")
turtle.setup(width=700, height=367)
turtle.color("White")
turtle.penup()

y = 140
y2 = -160
f = 20
f2 = 20
x3 = 330
y3 = -175
f3 = 10
fontT = "Cooper Black"
#__________________________________________________________________________________
____________________

elif num == 5:
turtle.bgpic("kiddo (1).gif")
turtle.setup(width=355, height=300)
turtle.color("Black")
turtle.penup()

y = 100
y2 = -110
f = 10
f2 = 10
x3 = 160
y3 = -130
f3 = 10
fontT = "Rockwell Extra Bold"
#__________________________________________________________________________________
______________________

message = turtle.textinput(title="Top words: ", prompt="Enter top quotes: ")


message2 = turtle.textinput(title="Bottom words: ", prompt="Enter bottom quotes: ")

turtle.penup()

turtle.color("Black")
turtle.goto(4, y + 2)
turtle.write(arg=message, move=False, align="Center", font=(fontT, f, "normal"))
turtle.goto(4, y2 + 2)
turtle.write(arg=message2, move=False, align="Center", font=(fontT, f2, "normal"))

turtle.color("White")
turtle.goto(0, y)
turtle.write(arg=message, move=False, align="Center", font=(fontT, f, "normal"))
turtle.goto(0, y2)
turtle.write(arg=message2, move=False, align="Center", font=(fontT, f2, "normal"))

turtle.color("Gold")
turtle.goto(x3, y3)
turtle.write(arg="TentPirz Meme Generator", move=False, align="Right",
font=("ALGERIAN", f3, "normal"))

turtle.done()

You might also like