Skip to content

Instantly share code, notes, and snippets.

@pvanallen
Last active February 15, 2019 21:52
Show Gist options
  • Save pvanallen/e14812f74d5f5cfd4f240a152eeff7c8 to your computer and use it in GitHub Desktop.
Save pvanallen/e14812f74d5f5cfd4f240a152eeff7c8 to your computer and use it in GitHub Desktop.
import random
adjectives = ["angry","bewildered","clumsy","defeated","embarrassed","fierce","grumpy","helpless","itchy","jealous","lazy","mysterious","nervous","obnoxious","panicky","repulsive","scary","thoughtless","uptight","worried","agreeable","brave","calm","delightful","eager","faithful","gentle","happy","jolly","kind","lively","nice","obedient","proud","relieved","silly","thankful","victorious","witty","zealous"]
verbs = ["add","allow","bake","bang","call","chase","damage","drop","end","escape","fasten","fix","gather","grab","hang","hug","imagine","itch","jog","jump","kick","knit","land","lock","march","mix","name","notice","obey","open","pass","promise","question","reach","rinse","scatter","stay","talk","turn","untie","use","vanish","visit","walk","work","yawn","yell","zip","zoom"]
nouns = ["apple","arm","banana","bike","bird","book","chin","clam","class","clover","club","corn","crayon","crow","crown","crowd","crib","desk","dime","dirt","dress","fang ","field","flag","flower","fog","game","heat","hill","home","horn","hose","joke","juice","kite","lake","maid","mask","mice","milk","mint","meal","meat","moon","mother","morning","name","nest","nose","pear","pen","pencil","plant","rain","river","road","rock","room","rose","seed","shape","shoe","shop","show","sink","snail","snake","snow","soda","sofa","star","step","stew","stove","straw","string","summer","swing","table","tank","team","tent","test","toes","tree","vest","water","wing","winter","woman","women"]
name = input('Enter a name: ')
# Open and read the template file
fo = open("template.html", "r")
html_template = fo.read();
fo.close()
# create the complete HTML
html_file = html_template.format(name, random.choice(adjectives), random.choice(nouns), random.choice(verbs), random.choice(nouns))
# write out the html file
fo = open("sentence.html", "w")
fo.write( html_file );
fo.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment