103.md
February 27, 2021 · View on GitHub
@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'
February 27, 2021 · View on GitHub
@author jackzhenguo
@desc
@date 2019/9/10
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'