반응형
Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- Google Spreadsheet
- 파이썬
- matplotlib
- math
- Github
- google apps script
- Tkinter
- PySpark
- Google Excel
- Java
- GIT
- list
- django
- string
- array
- SQL
- PANDAS
- gas
- Excel
- Mac
- Kotlin
- c#
- Redshift
- PostgreSQL
- Python
- hive
- dataframe
- Apache
- numpy
Archives
- Today
- Total
달나라 노트
Python os : os.environ.get (environment_variable_name) 본문
Python/Python os
Python os : os.environ.get (environment_variable_name)
CosmosProject 2021. 5. 11. 13:34728x90
반응형
컴퓨터에 저장된 환경변수를 python에서 불러오려면 os library를 사용하면 됩니다.
현재 제 컴퓨터에는
test_environ 이라는 이름의 환경변수에 'Cloud'라는 텍스트를 저장해놨다고합시다.
import os
val_env = os.environ.get('test_environ')
print(val_env)
-- Result
Cloud
만약 test_environ이라는 이름의 환경변수에 저장된 Cloud라는 내용을 불러오려면 위처럼 os.environ.get('환경변수이름')을 사용하면 됩니다.
728x90
반응형
'Python > Python os' 카테고리의 다른 글
| Python os : os.environ (현재 컴퓨터의 환경변수 출력) (0) | 2023.07.07 |
|---|---|
| Python os : os.path.exists (directory 또는 file 존재 여부 확인) (0) | 2021.06.30 |
| Python os : chdir (Directory 위치 변경) (0) | 2020.12.23 |
| Python os : getcwd (현재 Directory 위치 출력, 현재 디렉토리 위치, 현재 디렉토리 주소, 현재 디렉토리) (0) | 2020.12.23 |
| Python os : rename (file 이름 바꾸기) (0) | 2020.12.23 |
Comments