标签:
今天因为工作的缘故,需要用Python写一个能够完全分解文件名的小程序。
import os #path = os.path.abspath(‘.‘) def split_fully(name): parent_name,appendix = os.path.splitext(name) if appendix == ‘‘: return (parent_name,) else: return split_fully(parent_name) + (appendix, ) name = ‘E-GEOD-66998.processed.1.zip‘ result = split_fully(name) print(result)
Python tools used for file name devision
标签:
原文地址:http://www.cnblogs.com/JarningGau/p/5414561.html