Check If File or Directory Exists > PYTHON 프로그래밍

본문 바로가기

PYTHON 프로그래밍

PYTHON 프로그래밍

4. Check If File or Directory Exists

페이지 정보

작성자 관리자 댓글 0건 조회 6,238회 작성일 20-07-20 00:03

본문

4. Check If File or Directory Exists

import os.path

from os import path


def main():


   print ("File exists:"+str(path.exists('파일명.txt')))

   print ("directory exists:" + str(path.exists('myDirectory')))


if __name__== "__main__":

   main()


Copyright © LEELAB.CO.KR. All rights reserved.