I got it for the most part but when I put the unicode into a list the program does it letter by letter instead of as a whole. A single list full of the unicode was my goal.
with open('emoji-data.txt', 'rt') as in_file:
for line in in_file:
if ';' in line:
uni = line[:4]
s = line[6:11]
second = (s.lstrip('.'))
cleanuni = (uni.lstrip('# @m'))
new = list(cleanuni)
print(new)
Start with an empty list before the loop: emoji = []
.
Append each found word to the list: replace new = list(cleanuni)
with emoji.append(cleanuni)
.
Move the print
outside of the loop.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.