Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Python first try
- """
- Emoji Message Creator
- by Gguidini - January 2018
- Code takes a string as input and prints it using big letters made with emojis.
- Emojis available are displayed at first.
- There is an option to create a file with the message ready to be sent via WhatsApp or any app of the like.
- """
- # map of emoji codes
- emojis = { "grin":'\U0001F600', # grining face
- "smile":'\U0001F601', # grin with smiling eyes
- "lol":'\U0001F602', # laughing to tears
- "smile":'\U0001F603', # smiling face
- "trueSmile":'\U0001F604', # similing face and eyes
- "sweat":'\U0001F605', # similing face with drop
- "wink":'\U0001F609', # winking
- "cuteSmile":'\U0001F60A', # cute blushing smile
- "tongue":'\U0001F60B', # tongue out
- "cool":'\U0001F60E', # sunglasses
- "heartEyes":'\U0001F60D', # hearts in the eyes
- "heartKiss":'\U0001F618', # blowing kiss with heart
- "notAmused":'\U0001F612', # not amused face
- "sadFace":'\U0001F614', # sad face
- "shit":'\U0001F4A9', # smiling poop
- "smirk":'\U0001F60F', # smirking face
- "cry":'\U0001F62D', # full out tears
- "mindBlown":'\U0001F92F', # mind blown
- "redHeart":'\U00002764', # red heart
- "doubleHeart":'\U0001F495', # two pink hearts
- "greenHeart":'\U0001F49A' # green heart
- }
- # map of letter designs
- letters = { # LETTERS
- 'A':[0x18, 0x3C, 0x66, 0x66, 0x7E, 0x7E, 0x66, 0x66],
- 'B':[0x0F, 0x13, 0x13, 0x0F, 0x13, 0x33, 0x13, 0x0F],
- 'C':[0x3C, 0x7E, 0x43, 0x03, 0x03, 0x43, 0x7E, 0x3C],
- 'D':[0x0F, 0x13, 0x23, 0x63, 0x63, 0x23, 0x13, 0x0F],
- 'E':[0x7F, 0x03, 0x03, 0x0F, 0x0F, 0x03, 0x7F, 0x7F],
- 'F':[0x7F, 0x03, 0x03, 0x0F, 0x0F, 0x03, 0x03, 0x07],
- 'G':[0x3C, 0x7E, 0x43, 0x03, 0x73, 0x43, 0x7E, 0x3C],
- 'H':[0xE7, 0x66, 0x66, 0x7E, 0x7E, 0x66, 0x66, 0xE7],
- 'I':[0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C],
- 'J':[0xF0, 0x60, 0x60, 0x60, 0x60, 0x66, 0x66, 0x3C],
- 'K':[0x63, 0x33, 0x1B, 0x0F, 0x1B, 0x33, 0x63, 0xC3],
- 'L':[0x0F, 0x06, 0x06, 0x06, 0x06, 0x06, 0x46, 0x7F],
- 'M':[0xE7, 0xDB, 0xDB, 0xDB, 0xC3, 0xC3, 0xC3, 0xC3],
- 'N':[0xC3, 0xE3, 0xF3, 0xDB, 0xCF, 0xC7, 0xC3, 0xC3],
- 'O':[0x3C, 0x66, 0xC3, 0xC3, 0xC3, 0xC3, 0x66, 0x3C],
- 'P':[0x3F, 0x63, 0x63, 0x3F, 0x03, 0x03, 0x03, 0x07],
- 'Q':[0x3C, 0x66, 0xC3, 0xC3, 0xDB, 0xF3, 0x66, 0xBC],
- 'R':[0x3F, 0x63, 0x63, 0x3F, 0x1B, 0x33, 0x63, 0xC7],
- 'S':[0x3C, 0x66, 0xC3, 0x1C, 0x38, 0xC3, 0x66, 0x3C],
- 'T':[0xFF, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C],
- 'U':[0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x66, 0x3C],
- 'V':[0xC3, 0xC3, 0xC3, 0x66, 0x66, 0x66, 0x3C, 0x18],
- 'W':[0xC3, 0xC3, 0xC3, 0xC3, 0xDB, 0xDB, 0xDB, 0xE7],
- 'X':[0xC3, 0x66, 0x24, 0x18, 0x18, 0x24, 0x66, 0xC3],
- 'Y':[0xC3, 0x66, 0x24, 0x18, 0x18, 0x18, 0x18, 0x3C],
- 'Z':[0xFF, 0xE1, 0x60, 0x30, 0x18, 0x0C, 0x86, 0xFF],
- '0':[0x3C, 0x66, 0xC3, 0xDB, 0xDB, 0xC3, 0x66, 0x3C],
- '1':[0x3C, 0x36, 0x33, 0x30, 0x30, 0x30, 0x30, 0xFC],
- '2':[0x7C, 0xC6, 0x63, 0x30, 0x18, 0x0C, 0x06, 0xFF],
- '3':[0x3F, 0x60, 0xC0, 0x78, 0x78, 0xC0, 0x60, 0x3F],
- '4':[0x60, 0x78, 0x6C, 0x66, 0xFF, 0x60, 0x60, 0x60],
- '5':[0xFF, 0x03, 0x03, 0x3C, 0xC0, 0xC3, 0x66, 0x3C],
- '6':[0x78, 0x06, 0x03, 0x3F, 0x63, 0xC3, 0x66, 0x3C],
- '7':[0xFF, 0xFF, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03],
- '8':[0x3C, 0x66, 0xC3, 0x3C, 0x66, 0xC3, 0x66, 0x3C],
- '9':[0x3C, 0x66, 0xC3, 0xC6, 0xFC, 0xC0, 0x60, 0x1E],
- # SPACE AND PONCTUATION
- ' ':[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
- '-':[0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00],
- "'":[0xF0, 0xE0, 0xE0, 0x30, 0x00, 0x00, 0x00, 0x00],
- '!':[0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18]
- }
- # gets input
- print("Available Emojis")
- options = list(emojis.items())
- for moji in options:
- print("{0} = {1}".format(moji[0], moji[1]))
- # Emoji to be used
- emoji = input("What emoji will you use?\n")
- # File option
- opt = input("would you like to create file to copy the message? [Y/N]")
- opt = opt.upper()
- # String to output
- msg = input("what do you want to send?\n")
- msg = msg.upper().strip()
- if (opt.startswith("YES") or opt.startswith("Y")):
- opt = True
- else:
- opt = False
- # file for WhatsApp version
- if(opt):
- print("creating file...")
- file = open("out.txt", "w")
- file.write("```")
- def checkPrint(d, char) :
- if(bool(d&1)) :
- return char
- else: # double spaces because emojis are wider
- return " "
- # log for erros
- log = ""
- # iterates trough message to print it
- for s in msg:
- try:
- for i in letters[s] :
- line = ""
- for d in range(8) :
- line += checkPrint((i >> d), emojis.get(emoji , emojis["cuteSmile"]))
- print(line)
- line+='\n'
- if(opt):
- file.write(line)
- if(opt):
- file.write("\n")
- print("")
- except:
- log += "Character " + s + " unavailable\n"
- print(log)
- # finishes and closes file
- if(opt):
- file.write("```")
- file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement