본문 바로가기

개발자 모드/파이썬(python)

파이썬 os 모듈 활용하기

728x90


import os

output =  os.listdir(".")
print("os.listdir()_:",output)

print()


print("폴더와 파일을 구분하기")

for path in output :
    if os.path.isdir(path):
        print("폴더:",path)
    else :
        print("파일:",path)
        

728x90

'개발자 모드 > 파이썬(python)' 카테고리의 다른 글

파이썬 wxPython 설치 하는법  (0) 2021.05.19
파이썬 module 응용하기  (0) 2021.05.19
파이썬 urllib 모듈 활용법  (0) 2021.05.17
파이썬 time 모듈 사용  (0) 2021.05.17
파이썬 math 모듈 사용법  (0) 2021.05.17