일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 파이썬
- matplotlib
- PySpark
- numpy
- c#
- Mac
- gas
- PANDAS
- math
- SQL
- Java
- list
- array
- django
- Excel
- Apache
- Python
- Google Excel
- google apps script
- PostgreSQL
- Tkinter
- hive
- Google Spreadsheet
- dataframe
- GIT
- Kotlin
- string
- Github
- Redshift
- Today
- Total
목록exists (2)
달나라 노트
어떤 폴더나 파일의 경로를 나타낼 때 보통 우리는 아래와 같은 표현 방식을 사용합니다. my_program/tester/Code/test_program.py 근데 위 표현식은 OS에 따라 에러를 일으킬 수 있습니다. Mac/Linux에서는 폴더, 파일 구분자로서 슬래쉬(Slash, /)를 사용하지만, Windows에서는 폴더, 파일 구분자로서 역슬래쉬(Backward slash, \)를 사용하기 때문입니다. Mac/Linux = my_program/tester/Code/test_program.py Windows = my_program\tester\Code\test_program.py 혼자서 프로그래밍을 한다면 또는 그렇게 규모가 크지 않은 협업을 한다면 위 차이가 전혀 상관없을 수 있습니다. 저 또한 M..
Syntax os.path.exists(file_path) os.path.exists는 위처럼 사용 가능합니다. parameter로서 file_path를 받으며 file_path가 실제로 존재하면 True를 존재하지 않으면 False를 반환합니다. |-- test.py |-- test |-- sub_test |-- test.csv # test.py import os print(os.path.exists('test/')) # 1 print(os.path.exists('test/empty_test/')) # 2 print(os.path.exists('test/sub_test/test.csv')) # 3 -- Result True False True 위 예시를 봅시다. python code는 test.py에 ..