如果我有 64 位操作系统,我可以使用 cx_Freeze 制作 32 位程序吗? [英] Can I make a 32-bit program with cx_Freeze if I have a 64-bit OS?

查看:30
本文介绍了如果我有 64 位操作系统,我可以使用 cx_Freeze 制作 32 位程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在运行 64 位 Windows 7 Home,并且正在开发一个程序,我希望该程序可用于 32 位和 64 位 Windows 操作系统.当我使用 cx_Freeze 将我的 .py 转换为 .exe 时,它​​只允许它安装在 64 位操作系统上.

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.

我是否需要购买 32 位计算机才能将其转换为 32 位程序,或者是否有一组特殊的命令可以让 cx_Freeze 创建 32 位和 64 位 exe?

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
    )

推荐答案

不,您不需要购买另一台 PC(谢天谢地),也没有他们的命令.如果你想要一个 32 位的 .exe,你只需要一个 x32 位的 Python 安装并以正常方式冻结它,你就会有一个 x32 可执行文件.这适用于 x32 和 x64 计算机.

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.

由于您正在运行 x64 安装,您还可以创建 x64 .exe 并同时拥有 x32(如果您获得 x32 位安装)和 x64 .exe.

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.

这篇关于如果我有 64 位操作系统,我可以使用 cx_Freeze 制作 32 位程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆