简体   繁体   English

在 windows 终端 Python 中打印表情符号

[英]Print emojis in windows terminal Python

Here's the code:这是代码:

import emoji
import time

print("\U0001F600")
time.sleep(50)

Here's the output when I run in the python idle shell thingo:这是我在 python 空闲 shell 中运行时的 output: 在空闲外壳中输出

Here's the output when I run the program in windows terminal thingo:当我在 windows 终端中运行程序时,这是 output: windows终端输出

I've got this game thing I'm working on for an assignment, and I've simply just copy pasted emojis into the print function, and when I run it in PyCharm, it works just like in idle shell.我有这个我正在做的游戏任务,我只是将粘贴的表情符号复制到打印 function 中,当我在 PyCharm 中运行它时,它就像在空闲的 Z2591C98B701424FE5E26 中一样工作But when I turn it into an executable using the pyinstaller module thing, it just shows?但是当我使用 pyinstaller 模块把它变成一个可执行文件时,它只是显示? instead of the emoji.而不是表情符号。

By the way, I'm not that advanced in this kinda thing, so I'd appreciate if someone could explain how to fix this problem:)顺便说一句,我在这种事情上并不那么先进,所以如果有人能解释如何解决这个问题,我将不胜感激:)

This does not work in the normal cmd console.这在普通的 cmd 控制台中不起作用。 If so, you need the Terminal如果是这样,您需要终端

我的结果

(In addition, you do not need the emoji module for your method) (此外,您的方法不需要表情符号模块)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM