Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

命令行中无法使用input #26

Open
yulk opened this issue Dec 14, 2022 · 2 comments
Open

命令行中无法使用input #26

yulk opened this issue Dec 14, 2022 · 2 comments

Comments

@yulk
Copy link

yulk commented Dec 14, 2022

F:\SMALL\PyStand-py38>Hello from F:\SMALL\PyStand-py38\PyStand.int

Traceback (most recent call last):
File "", line 34, in
File "F:\SMALL\PyStand-py38\PyStand.int", line 10, in
filename = input("请输入EXCEL文件名(带后缀,EXCEL文件放在本文件同目录)")
RuntimeError: input(): lost sys.stdin

@yulk
Copy link
Author

yulk commented Dec 14, 2022

修改CMakeLists.txt:

option(PYSTAND_CONSOLE "Build PyStand as a console application." ON)

自行编译的版本可以。希望下次release的时候直接发个控制台的版本。

F:\SMALL\PyStand-py38>PyStand.exe
Hello from F:\SMALL\PyStand-py38\PyStand.int
请输入EXCEL文件名(带后缀,EXCEL文件放在本文件同目录)hello.txt
F:\SMALL\PyStand-py38\runtime\python38.zip
F:\SMALL\PyStand-py38\runtime
F:\SMALL\PyStand-py38
F:\SMALL\PyStand-py38\site-packages

@skywind3000
Copy link
Owner

不用修改,cmake 初始化时加上:

-DPYSTAND_CONSOLE=ON

即可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants