我可以在Mac上生成可在Windows上使用的python可执行文件吗? [英] Can I generate a python executable file on my Mac that can be used on Windows
问题描述
我正在用Mac笔记本电脑编程python,但是最终的可执行文件将在最终用户的Windows系统上运行. Windows系统还没有专门设置python环境.
I am programming python with my Mac laptop, however, the final executable will be run on final users' Windows system. And the Windows system hasn't set up the python environment specifically.
我可以在Mac笔记本电脑上生成可执行文件,并且Windows用户可以直接在Windows系统上运行吗?
Can I generate an executable file on my Mac laptop, and Windows user can directly run on Windows system?
我查看了py2exe,但似乎必须在Windows上构建python才能在Windows上运行exe.
I looked at py2exe, but it seems it must build the python on Windows in order to run the exe on Windows.
推荐答案
您无法在OS X上生成Windows可执行文件.您必须使用要在其上运行程序的平台来编译该程序.如果您拥有Windows副本,则可以在Mac上运行虚拟机并在其上进行编译.
You can not generate Windows executable files on OS X. You must use the platform which you want the program to run on to compile the program. If you own a copy of Windows, you could run a virtual machine on you Mac and compile it on that.
这篇关于我可以在Mac上生成可在Windows上使用的python可执行文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!