1、安装pyInstaller
pip install pyinstaller
成功后显示successfully…
2 、进入py文件目录
3 、 pyinstaller.py -F 文件.py
4 、生产exe在dist中
具体例子
1、Cd C:\Users\Administrator\Desktop\c2p\ConsoleApplication1
2、pyinstaller.py -F great_module.py
module.py 如下
3、进入dist有exe
4、运行 进入dist 运行exe
5、在C++中运行
#include “stdafx.h”
//#include
//#include <Python.h>
#include <stdlib.h> //system(“pause”); 暂停,按键继续
//#include <Windows.h>
int main(int argc, _TCHAR* argv[])
{
WinExec(“C:\Users\Desktop\c2p\ConsoleApplication1\dist\great_module.exe”, SW_SHOWNORMAL);//win下‘\’
system(“pause”);
return 0;
}