Skip to content

Commit 66f03ca

Browse files
authored
Merge pull request #132 from PdxCodeGuild/kelin_mini_capstone
Kelin mini capstone
2 parents 59fe4bd + cb6e768 commit 66f03ca

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

code/kelin/labs/emojicodes.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:pregnant_woman::old_man:

code/kelin/labs/mini_capstone.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# https://pypi.org/project/emoji/ emoji 2.0.0
2+
# pip install emoji
3+
# emoji list https://carpedm20.github.io/emoji/
4+
5+
# https://pypi.org/project/word2emoji/ word2emoji 0.1.5
6+
# pip install word2emoji
7+
8+
import emoji
9+
import word2emoji
10+
11+
# using emoji list adding emoji codes to a string
12+
13+
14+
print(emoji.emojize(f'Learning Python is :downcast_face_with_sweat: sometimes it can even make me feel like :exploding_head: !!!'))
15+
16+
# emojize takes the code and displays the emoji
17+
18+
def user_prompt_get_emoji(phrase):
19+
word = input(phrase)
20+
wordemoji = word2emoji(word)
21+
return wordemoji
22+
23+
# deployed a function to take the user input for the emoji
24+
learning = []
25+
while True:
26+
wordemoji = user_prompt_get_emoji('Enter a word to describe learning Python: ')
27+
28+
# word = input(f'Enter a word to describe learning Python: ')
29+
# wordemoji = word2emoji(word)
30+
31+
wordtwoemoji = user_prompt_get_emoji('Enter another word: ')
32+
33+
# word2emoji takes a word and turns it into an emoji
34+
35+
learning.append ({
36+
'Learning Python is' : wordemoji,
37+
'sometimes it can make me feel like' : wordtwoemoji
38+
})
39+
40+
# The user inputed word is turned into an emoji
41+
42+
# emoji.demojize takes the emoji and displays the code for it
43+
44+
emojicode = emoji.demojize(wordemoji)
45+
emojicodetwo= emoji.demojize(wordtwoemoji)
46+
47+
# The emojis are turned into a message and the codes are displayed to user
48+
49+
print(learning, 'The text consists of 2 emoji codes and their translations.', emojicode, 'and', emojicodetwo, emoji.emojize(emojicode), emoji.emojize(emojicodetwo))
50+
51+
with open('emojicodes.csv', 'w') as emojicodefile:
52+
emojicodefile.write(emojicode)
53+
emojicodefile.write(emojicodetwo)
54+
55+
# write the user emoji codes to a csv file
56+
57+
# Add support for entering own emoji codes to display
58+
59+
# Add support for all emoji codes
60+
61+
62+
# find support for AI generated content
63+

0 commit comments

Comments
 (0)