Last active
December 6, 2017 17:03
-
-
Save AO8/db294634ee19d4c00599f62713b8c247 to your computer and use it in GitHub Desktop.
"You sir, are a bawdy, milk-livered canker-blossom!" Randomly create Shakespearean insults just like this with this simple insult generator using Python and Tkinter. Corresponding CSV file included, modified from PDF at https://www.theatrefolk.com/free-resources.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
artless | base-court | apple-john | ||
---|---|---|---|---|
bawdy | bat-fowling | baggage | ||
beslubbering | beef-witted | barnacle | ||
bootless | beetle-headed | bladder | ||
churlish | boil-brained | boar-pig | ||
cockered | clapper-clawed | bugbear | ||
clouted | clay-brained | bum-bailey | ||
craven | common-kissing | canker-blossom | ||
currish | crook-pated | clack-dish | ||
dankish | dismal-dreaming | clotpole | ||
dissembling | dizzy-eyed | coxcomb | ||
droning | doghearted | codpiece | ||
errant | dread-bolted | death-token | ||
fawning | earth-vexing | dewberry | ||
fobbing | elf-skinned | flap-dragon | ||
froward | fat-kidneyed | flax-wench | ||
frothy | fen-sucked | flirt-gill | ||
gleeking | flap-mouthed | foot-licker | ||
goatish | fly-bitten | fustilarian | ||
gorbellied | folly-fallen | giglet | ||
impertinent | fool-born | gudgeon | ||
infectious | full-gorged | haggard | ||
jarring | guts-griping | harpy | ||
loggerheaded | half-faced | hedge-pig | ||
lumpish | hasty-witted | horn-beast | ||
mammering | hedge-born | hugger-mugger | ||
mangled | hell-hated | jolthead | ||
mewling | idle-headed | lewdster | ||
paunchy | ill-breeding | lout | ||
pribbling | ill-nurtured | maggot-pie | ||
puking | knotty-pated | malt-worm | ||
puny | milk-livered | mammet | ||
quailing | motley-minded | measle | ||
rank | onion-eyed | minnow | ||
reeky | plume-plucked | miscreant | ||
roguish | pottle-deep | moldwarp | ||
ruttish | pox-marked | mumble-news | ||
saucy | reeling-ripe | nut-hook | ||
spleeny | rough-hewn | pigeon-egg | ||
spongy | rude-growing | pignut | ||
surly | rump-fed | puttock | ||
tottering | shard-borne | pumpion | ||
unmuzzled | sheep-biting | ratsbane | ||
vain | spur-galled | scut | ||
venomed | swag-bellied | skainsmate | ||
villainous | tardy-gaited | strumpet | ||
warped | tickle-brained | varlet | ||
wayward | toad-spotted | vassal | ||
weedy | urchin-snouted | whey-face | ||
yeasty | weather-bitten | wagtail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tkinter import * | |
from tkinter import ttk | |
import random | |
class InsultApp: | |
def __init__(self, master): | |
master.title("Shakespearean Insult Generator") | |
master.resizable(False, False) | |
master.configure(background = "#fff") | |
self.style = ttk.Style() | |
self.style.configure("TFrame", background = "#fff") | |
self.style.configure("TLabel", background = "#fff", font = ("Verdana", 11)) | |
self.label = ttk.Label(master, text = "This simple Python-powered app randomly generates insults of Shakespearean proportions!") | |
self.label.grid(row=0) | |
ttk.Button(master, text = "Go Ahead, Insult Me", command = self.insult_me).grid(row=1) | |
def insult_me(self): | |
list_a = [] | |
list_b = [] | |
list_c = [] | |
filename = "shakespeare_insults.csv" | |
with open(filename, "r") as f_obj: | |
for line in f_obj: | |
words = line.split(",") | |
list_a.append(words[0].strip()) | |
list_b.append(words[1].strip()) | |
list_c.append(words[2].strip()) | |
word_a = random.choice(list_a) | |
word_b = random.choice(list_b) | |
word_c = random.choice(list_c) | |
person = random.choice(["sir", "madam"]) | |
article = "an" if word_a[0] in "aeiou" else "a" | |
insult = f"You {person}, are {article} {word_a}, {word_b} {word_c}!" | |
self.label.config(text = insult) | |
def main(): | |
root = Tk() | |
app = InsultApp(root) | |
root.mainloop() | |
if __name__ == "__main__": main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment