开发者

How to get the arch string that distutils uses for builds?

开发者 https://www.devze.com 2022-12-12 08:52 出处:网络
When I build a c extension using python setup.py build, the result is created under a directory named

When I build a c extension using python setup.py build, the result is created under a directory named

build/lib.linux-x86_64-2.6/

where the part after lib. changes by the OS, CPU and Python version.

Is there a way I can access the appropriate string for my curren开发者_StackOverflow社区t architecture from python? Hopefully in a way that is guaranteed to match what distutils is creating.


>>> from distutils import util
>>> util.get_platform()
'linux-x86_64'

>>> import sys
>>> '%s.%s' % sys.version_info[:2]
2.6
0

精彩评论

暂无评论...
验证码 换一张
取 消