这里用到了os.path.splitext()和os.path.split()。
函数  | 作用  | 返回值  | 
  | 分割文件名和扩展名  | 元组  | 
  | 分割路径和文件名  | 元组  | 
例子:
import os
url = "http://file.iqilu.com/custom/new/v2016/images/logo.png"
(file, ext) = os.path.splitext(url)
print(file)
print(ext)
(path, filename) = os.path.split(url)
print(filename)
print(path)

 参考:
 https://docs.python.org/3/library/os.path.html










