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

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

问题描述

我当前正在运行Windows 7 Home 64位,并且正在开发一个程序,该程序可用于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,也不需要他们的no命令。如果您需要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天全站免登陆