我将 py 文件转换为 exe 文件 (pyinstaller) 我在输入前使用了打印语句但是 运行 exe 文件不打印并接受输入

I converted py file to an exe file (pyinstaller) i used a print statement before input but while running the exe file it doesnt print and takes input

snippet of exe file after opening and entering a number

打开 .exe 文件后,它显示一个闪烁的光标,但它必须根据代码打印 'enter a number',但在我输入任何数字后,它会打印语句以及我输入的数字...是有没有办法在输入值之前打印该语句?

您尝试过使用 input() 吗?

def check():
    d = int(input("Guess the number: "))

我假设你使用的是Python 3,如果你使用的是Python 2你需要使用raw_input().