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
- datetime #zip
- 자연어처리 환경 컨테이너
- airflow
- 파일저장
- 자동화
- 원하는 태그 찾기
- requesthead
- beautifulsoup
- text.children
- aiflow
- pickle #datetime
- 빗썸api
- mariadb설치 #mysql설치
- cron
- ssh operator
- JavaScripts
- 가상환경 초기세팅
- requests
- etl
- Docker
- celery
- enumerate #함수 # def
- FastAPI
- 모델서빙
- HeidiSQL
- with open
- 리눅스 # 기초
- K-ICT
- 정규표현식
- Google Cloud Storage
Archives
- Today
- Total
오음
python) os 모듈 활용 본문
import os
os.getcwd() # 경로확인
'c:\\workspace'
os.mkdir("test") # 파일생성
# 절대 경로 -> c:\\workspace\\test
# 상대 경로 -> ./test
os.listdir("./") # 모든 파일 리스트 검색
os.walk("c:/") # 하위 디렉토리 검색
# 모든 파일에서 .py 파일만 뽑기
path = "./"
file_list = os.listdir(path)
file_list_py = [file for file in file_list if file.endswith(".py")]
print (file_list_py)
# 현재 경로에 test폴더 있는지 확인
os.path.isdir("./test")
True
# 경로 바꾸기
os.chdir
# 파일 check하고 생성
if os.path.isdir("./data") == False:
os.mkdir("./data")
'데이터 엔지니어링 > 파이썬' 카테고리의 다른 글
python) 정규표현식 생각 안날 때 (0) | 2023.03.09 |
---|---|
python) BeautifulSoup 활용하기 (0) | 2023.03.07 |
python) enumerate모듈, def 함수 만들기 (1) | 2023.03.07 |
python) Crawling 활용하기, 데이터 저장하기(pickle) (0) | 2023.03.06 |
python) datetime, zip (0) | 2023.03.06 |