python编译exe同时支持32位,64位python可以创建32位Windows可执行文件吗

I have a new 64-bit Windows machine and use python for various things and so would prefer to install 64-bit python.

However, one of my python projects creates a Windows executable that is then run on a 32-bit Windows machine (created using py2exe).

How do I use 64-bit python and py2exe to create a 32-bit executable?

If I can't do that, I guess my choices are:

Use 32-bit python on all machines

including mine; or

Install python on

the 32-bit machines and don't use

py2exe.

Any advice much appreciated.

解决方案

You can install both 32 and 64 bit Python on the machine and use the py2exe associated with each installation.

However, unless you actually need the extra address space of 64 bit, then you may as well just stick to 32 bit Python for compatibility. You may well find that 3rd party modules will have better availability if you are using 32 bit.

Update: Three years have passed since I wrote this. Would I stick to the advice about 64 bit Python? Probably. It is certainly true that 64 bit third party modules are easier to come by. Not least thanks to Christoph Gohlke's wonderful site.

But it is still the case the every now and again you'll find it hard to get a 64 bit version of an extension that you need. So, if your program works perfectly well in a 32 bit process, then it is perfectly sound to stick to 32 bit.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值