[python]os.path.exists() 파일 존재 체크하기 정보
Linux [python]os.path.exists() 파일 존재 체크하기본문
#!/usr/bin/python
import os
if not os.path.exists("./test.txt"):
print "test.txt file not exist"
if os.path.exists("./test.txt"):
print "test.text file exist"
root@byoungguk-desktop:~# ./existtest.py
test.txt file not exist
root@byoungguk-desktop:~# touch test.txt
root@byoungguk-desktop:~# ./existtest.py
test.text file exist
추천
0
0
댓글 0개