Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 245 Bytes

103.md

File metadata and controls

18 lines (15 loc) · 245 Bytes
@author jackzhenguo
@desc 
@date 2019/9/10

103 获取后缀名

import os
file_ext = os.path.splitext('./data/py/test.py')
front,ext = file_ext
In [5]: front
Out[5]: './data/py/test'

In [6]: ext
Out[6]: '.py'