Emoji 字符是 Unicode 字符集中的一部分谍椅。也就是說勉盅, Emoji 符號就是一個文字,它會被渲染為圖形牺氨。
在代碼中注釋中添加 emoji 豈不是美滋滋狡耻。
emoji
1墩剖、emoji庫安裝
pip install emoji
2、emoji庫測試
import emoji
print(emoji.emojize('Your :horse: is gone'))
#Your ?? is gone
3夷狰、輸出其他emoji表情
在python中岭皂,我們還可以利用擴展庫emoji ,這個庫給表情起了“別名”(見下圖)沼头,以便通過“別名”爷绘,獲取emoji表情。
https://www.webfx.com/tools/emoji-cheat-sheet/
emoji表情
import emoji
print(emoji.emojize("Your :horse: is gone ",use_aliases = False ), end = '' )
print(emoji.emojize("Just your :woman: leave the :musical_score: ",use_aliases = True ), end = '' )
print(emoji.emojize("You are :cow: :beer: ",use_aliases = True ), end = '' )
1进倍、#Your ?? is gone
2土至、#Just your ?? leave the ??
3、#You are ?? ??