파이썬[Python]: platform - architecture 메서드
platform 모듈 - architecture 메서드(method)
/// 설명
실행 가능한 파일의 구조를 반환합니다.(기본값으로 파이썬 인터프리터 바이너리를 사용합니다.)
bit 구조(bit architecture)와 파일형식(linkage format)을 튜플로 반환합니다.
참고: sys.executable
※ 형식
platform.architecture(executable=sys.executable, bits='', linkage='')
reference
https://docs.python.org/3/library/platform.html#module-platform
bit 구조(bit architecture)와 파일형식(linkage format)을 튜플로 반환합니다.
참고: sys.executable
※ 형식
platform.architecture(executable=sys.executable, bits='', linkage='')
reference
https://docs.python.org/3/library/platform.html#module-platform
/// 예제
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import sys import platform print(sys.executable) # C:\Users\psych\anaconda3\envs\Practice\python.exe print(platform.architecture()) # ('64bit', 'WindowsPE') print(platform.architecture(executable=sys.executable)) # ('64bit', 'WindowsPE') print(platform.architecture(executable=r'C:\Users\psych\anaconda3\envs\Practice\python.exe')) # ('64bit', 'WindowsPE') print(platform.architecture(executable=r'C:\Users\psych\anaconda3\envs\Practice\venvlauncher.exe')) # ('64bit', '') print(platform.architecture(executable=r'C:\Windows\System32\cmd.exe')) # ('64bit', '') if platform.architecture()[0] == '64bit': print(True) else: print(False) | cs |
* 실행환경: Microsoft Windows 10 Homes
* 인터프리터: 파이썬(Python 3.9)
– 당신을 응원합니다. –
댓글
댓글 쓰기