#coding=utf-8import osurl='https://rumenz.com/static/cimg/wx.jpg'(path,file_ext)=os.path.splitext(url)print("前面的路径:"+path)print("文件扩展名为:"+file)# 输出 .jpg
#coding=utf-8
import os
url='https://rumenz.com/static/cimg/wx.jpg'
(path,file_ext)=os.path.splitext(url)
print("前面的路径:"+path)
print("文件扩展名为:"+file)
# 输出 .jpg
【Linux常用命令速查手册】关注【入门小站】,后台回复 「1001」 自取。