Python如何获取文件扩展名【面试题详解】

今天爱分享给大家带来Python如何获取文件扩展名【面试题详解】,希望能够帮助到大家。
使用os.path.splitext方法:


>>> import os
>>> fileName, fileExtension = os.path.splitext('/path/to/somefile.ext')
>>> fileName
'/path/to/somefile'
>>> fileExtension
'.ext'

原文链接:https://blog.itblood.com/4410.html,转载请注明出处。
0
菲拉的契约娼馆V1.2 内嵌AI汉化版+修图[更新][1.5G] [爆乳RPG/汉化/动态/CV]
菲拉的契约娼馆V1.2 内嵌AI汉化版+修图[更新][1.5G] [爆乳RPG/汉化/动态/CV]
5分钟前 有人购买 去瞅瞅看

站点公告

显示验证码
没有账号?注册  忘记密码?