Passion/Python

Python version check

sunshout 2019. 6. 4. 22:40

Python code를 작성하다보면 모듈이나 문법에 따라서 특정 버전 이상이 필요할 때가 있다.

코드 내에서 버전 체크 방법

import sys
assert sys.version_info < (2.7)