时间:2021-07-01 10:21:17 帮助过:322人阅读
如:地址为 http://www.gxlcms.com/images/logo.gif 要想从该地址提取logo.gif,只需要一句代码就可以搞定
import os url = 'http://www.gxlcms.com/images/logo.gif' filename = os.path.basename(url) print(filename)
输出为:
logo.gif
希望本文所述对大家的Python程序设计有所帮助。