반응형
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 |
Tags
- Python
- math
- Excel
- c#
- Mac
- django
- PySpark
- Tkinter
- Google Spreadsheet
- 파이썬
- list
- gas
- Apache
- Java
- string
- GIT
- Redshift
- dataframe
- Github
- google apps script
- Google Excel
- array
- Kotlin
- PANDAS
- numpy
- hive
- PostgreSQL
- SQL
- matplotlib
Archives
- Today
- Total
목록__name__ (1)
달나라 노트
Python Basic : __name__ (직접 실행/패키지 실행 구분하기)
python의 내장변수 중 __name__이라는 변수는 해당 python 파일을 직접 실행시키는지 library로 import해서 실행시키는지에 따라 값이 달라집니다. 직접 실행할 경우 -> __name__ == '__main__' library로 import되어 실행된 경우 -> __name__ == '파일명' # name_test.py print(__name__) -- Result __main__ name_test.py 파일을 직접 실행한 경우 __name__이라는 내장변수에는 __main__이라는 값이 저장됩니다. 위 예시의 결과에서 알수있죠. # final.py import name_test -- Result name_test final.py 에서 test.py를 import했습니다. 그리고 fi..
Python/Python Basic
2021. 6. 26. 18:35