网络编程
位置:首页>> 网络编程>> Python编程>> python获取文件路径、文件名、后缀名的实例

python获取文件路径、文件名、后缀名的实例

作者:insisted_search  发布时间:2022-05-05 10:47:27 

标签:python,文件名,后缀名,获取,路径

实例如下所示:


#########start 获取文件路径、文件名、后缀名############
def jwkj_get_filePath_fileName_fileExt(filename):
 (filepath,tempfilename) = os.path.split(filename);
 (shotname,extension) = os.path.splitext(tempfilename);
 return filepath,shotname,extension
#########end 获取文件路径、文件名、后缀名############

来源:https://blog.csdn.net/insisted_search/article/details/60156283

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com