programming/python
tip - '64bit'? '32bit'? 비트 아키텍처 확인 방법
slothCat
2021. 1. 12. 20:07
728x90
1) platform 모듈 이용
platform.architecture(executable=sys.executable, bits='', linkage='')
다양한 아키텍처 정보에 대해 주어진 실행 파일(기본값은 파이썬 인터프리터 바이너리)을 조회합니다.
코드
import platform
print(platform.architecture())
실행 결과
2) sys.maxsize 이용
platform — 하부 플랫폼의 식별 데이터에 대한 액세스 — Python 3.7.9 문서
platform — 하부 플랫폼의 식별 데이터에 대한 액세스 소스 코드: Lib/platform.py 참고 각 플랫폼은 알파벳순으로 나열되고, 리눅스는 유닉스 절에 포함됩니다. 크로스 플랫폼 platform.architecture(executabl
docs.python.org
반응형