forked from souravjain540/Basic-Python-Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmoji_Convertor
100 lines (90 loc) · 2.75 KB
/
Emoji_Convertor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import tkinter as tk
from tkinter import ttk
# Define a function to convert the input message to emojis
def convert_message():
# Get the input message from the Entry widget
message = message_entry.get()
# Split the message into words
words = message.split()
# Define a dictionary of emojis
emojis = {
":)": "😄",
":(": "😔",
":D": "😁",
":p": "😋",
":o": "😲",
";)": "😉",
":/": "😕",
":|": "😐",
":*": "😘",
"<3": "❤️",
":heart:": "❤️",
":poop:": "💩",
":fire:": "🔥",
":thumbsup:": "👍",
":thumbsdown:": "👎",
":ok_hand:": "👌",
":clap:": "👏",
":muscle:": "💪",
":pray:": "🙏",
":rocket:": "🚀",
":earth:": "🌍",
":sun:": "☀️",
":moon:": "🌙",
":star:": "⭐️",
":cloud:": "☁️",
":umbrella:": "☔️",
":snowflake:": "❄️",
":zap:": "⚡️",
":bell:": "🔔",
":gift:": "🎁",
":birthday:": "🎂",
":tada:": "🎉",
":balloon:": "🎈",
":camera:": "📷",
":book:": "📚",
":computer:": "💻",
":iphone:": "📱",
":tv:": "📺",
":moneybag:": "💰",
":gem:": "💎",
":key:": "🔑",
":hammer:": "🔨",
":wrench:": "🔧",
":bulb:": "💡",
":lock:": "🔒",
":unlock:": "🔓",
":warning:": "⚠️",
":exclamation:": "❗️",
":question:": "❓",
":heart_eyes:": "😍",
":sunglasses:": "😎",
":facepalm:": "🤦♂️",
":shrug:": "🤷♀️",
":man_dancing:": "🕺",
":woman_dancing:": "💃",
":man_in_tuxedo:": "🤵",
":bride_with_veil:": "👰",
":pregnant_woman:": "🤰",
":breastfeeding:": "🤱",
}
# Convert each word to an emoji if it exists in the dictionary
output = " "
for word in words:
output += emojis.get(word.lower(), word) + " "
# Update the Label widget with the output message
output_label.config(text=output)
# Create a Tkinter window
window = tk.Tk()
window.title("Emoji Converter")
# Create a Tkinter Entry widget for the user to enter the message
message_entry = ttk.Entry(window)
message_entry.pack()
# Create a Tkinter Button widget to convert the message to emojis
convert_button = ttk.Button(window, text="Convert", command=convert_message)
convert_button.pack()
# Create a Tkinter Label widget to display the output message
output_label = ttk.Label(window, font=("Segoe UI Emoji", 12))
output_label.pack()
# Start the Tkinter event loop
window.mainloop()