일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- Kotlin
- dataframe
- PySpark
- Github
- SQL
- Tkinter
- PANDAS
- 파이썬
- Python
- gas
- matplotlib
- Google Excel
- Java
- google apps script
- Mac
- array
- Google Spreadsheet
- string
- Excel
- Apache
- numpy
- PostgreSQL
- GIT
- hive
- c#
- django
- math
- Redshift
- list
- Today
- Total
목록SYS (3)
달나라 노트
Syntax sys.version_info sys 모듈의 version_info를 이용하면 현재 실행된 python의 version을 알 수 있습니다. [terminal]$ python --version -- Result Python 3.10.11 먼저 terminal에서 python --version 명령어를 이용해서 python 버전 정보를 출력해보면 위와 같습니다. import sys print(sys.version_info) -- Result sys.version_info(major=3, minor=10, micro=11, releaselevel='final', serial=0) 그리고 sys.version_info를 이용하면 위같은 결과가 나옵니다. 아까 python version이 3.10.1..
Python library중 하나인 sys의 path는 환경 변수(PYTHONPATH)의 list를 출력해줍니다. import sys print(sys.path) -- Result [ '/Users/Documents/Code', '/Users/Documents/Code/temporary', '/Users/.conda/envs/customs', '/Users/.conda/envs/customs/lib/python3.8', '/Users/.conda/envs/customs/lib/python3.8/lib-dynload', '/Users/.conda/envs/customs/lib/python3.8/site-packages' ] sys.path를 이용해서 그 내용을 출력해보면 위같이 여러 경로가 list에 담긴..
python 파일을 실행하는 방법은 사용하는 code editor 내에서 실행하는 방법도 있지만 terminal(또는 명령 프롬프트 등)에서 직접 해당 파일을 실행할 수도 있습니다. test.py print('Hello world!') test.py 파일에 위와 같은 print 코드를 적어두고 위처럼 terminal에서 test.py 파일이 있는 위치로 이동한 후 python 형태로 명령어를 적어주면 test.py가 실행되는 것을 알 수 있죠. 이처럼 terminal에서 python 파일을 실행시킬 때에는 단순히 파일 실행 뿐 아니라 위 이미지처럼 파일 실행 시 옆에 apple, banana, sky 등 여러 기타 인자들을 전달할 수 있습니다. 위처럼 전달된 인자들을 받기 위해서는 sys.argv를 사용..