问题
I am currently running Windows 7 Home 64-bit and am working on a program that I would like to make available for both 32-bit and 64-bit Windows operating systems. When I use cx_Freeze to turn my .py to a .exe, it only allows it to be installed on 64-bit operating systems.
Would I need to buy a 32-bit computer to convert it to a 32-bit program or are there a special set of commands I can use to make cx_Freeze create both a 32-bit and a 64-bit exe?
from cx_Freeze import *
import sys
base = None
if sys.platform == 'win32':
base = "Win32GUI"
executables = [Executable("iNTMI.py", shortcutName = "iNTMI", shortcutDir = "DesktopFolder", base = base, icon = "C:/Program Files/iNTMI/assets/images/programIcon.ico")]
setup(
name = "iNTMI",
options = {"build_exe": {"packages": ["tkinter", "minecraftItems", "ProgFunctions", "minecraftItems"], "include_files": ["ProgFunctions.py", "minecraftItems.py"]}},
executables = executables
)
回答1:
No you do not need to buy another PC (thankfully) and no theirs no command for it either. If you want a 32bit .exe you just need an x32 bit Python installation and freeze it in the normal way and you will have a x32 executable. This will work on both x32 and x64 computers.
Since you are running x64 installation you can also create x64 .exe and have both x32 (if you get a x32 bit installation) and x64 .exe.
来源:https://stackoverflow.com/questions/31516951/can-i-make-a-32-bit-program-with-cx-freeze-if-i-have-a-64-bit-os