Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 318 Bytes

103.md

File metadata and controls

20 lines (16 loc) · 318 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'
[上一个例子](102.md) [下一个例子](104.md)