Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我可以将Python CLI程序编译为exe并运行它吗?_Python_User Interface_Compilation_Pyqt5_Pyinstaller - Fatal编程技术网

我可以将Python CLI程序编译为exe并运行它吗?

我可以将Python CLI程序编译为exe并运行它吗?,python,user-interface,compilation,pyqt5,pyinstaller,Python,User Interface,Compilation,Pyqt5,Pyinstaller,基本上,我是Python新手,我已经制作了一个程序,一次又一次地垃圾发送一个单词。我已经制作了一个GUI版本,并用PyInstaller将其编译为.exe,但我还想编译非GUI版本,使其像GUI版本一样在每个Windows 10上运行。我知道,由于我的非GUI版本没有GUI,因此它将在CMD中运行,但这可能吗?我是否可以将非GUI版本编译为.exe并在任何Windows 10(如GUI版本)上运行它?如果是,如何进行 顺便说一句,我曾尝试从PyInstaller将非GUI版本编译为.exe,它确

基本上,我是Python新手,我已经制作了一个程序,一次又一次地垃圾发送一个单词。我已经制作了一个GUI版本,并用PyInstaller将其编译为.exe,但我还想编译非GUI版本,使其像GUI版本一样在每个Windows 10上运行。我知道,由于我的非GUI版本没有GUI,因此它将在CMD中运行,但这可能吗?我是否可以将非GUI版本编译为.exe并在任何Windows 10(如GUI版本)上运行它?如果是,如何进行

顺便说一句,我曾尝试从PyInstaller将非GUI版本编译为.exe,它确实为我编译了它,但它没有运行并抛出错误

无法执行脚本


提前谢谢。

关于这一点,已经有不少话题可能会对您有所帮助。在这两个问题上,我都找不到答案。我想问的是,我是否可以运行一个没有GUI代码(在控制台中运行)的python脚本,并将其转换为某种编译文件,该文件也在控制台中运行,但在机器中没有安装python的情况下也可以运行。每当我用没有GUI的PyInstaller将py文件编译成.exe时,它会编译它,但.exe无法运行,它会说“脚本无法运行”之类的话。我的脚本或PyInstaller有问题吗?然后呢?