In [1]:
import os
In [8]:
os
Out[8]:
In [4]:
os.path
Out[4]:
In [5]:
os.path.exists
Out[5]:
In [6]:
os.path.exists('no_such_file')
Out[6]:
In [7]:
os.path.exists('hello_world.txt')
Out[7]:
In [10]:
# 절대경로
os.path.abspath('hello_world.txt')
Out[10]:
In [11]:
# 경로 합치기
os.path.join('users', 'seongjoo', 'python')
Out[11]:
In [17]:
filepath = 'some_other_folder/some_file.txt'
os.path.split(filepath)
Out[17]:
In [ ]: