当前位置:网站首页>【os.path】的相关用法(持更)
【os.path】的相关用法(持更)
2022-08-08 13:34:00 【panbaoran913】
01、‘abspath’,
02、 ‘altsep’,
03、 basename
返回文件路径中的最后的文件名,如果以/结尾,则返回None
04、 ‘commonpath’,
05、 ‘commonprefix’,
06、 ‘curdir’,
07、 ‘defpath’,
08、 ‘devnull’,
09、 dirname,
返回去掉文件名的路径
10、 ‘exists’, 判断路径是否存在

11、 ‘expanduser’,
12、 ‘expandvars’,
13、 ‘extsep’,
14、 ‘genericpath’,
15、 ‘getatime’,
16、 ‘getctime’,
17、 ‘getmtime’,
17、 ‘getsize’,
19、 ‘isabs’,
20 、 ‘isdir’,
21、 ‘isfile’,
22、 ‘islink’,
23、 ‘ismount’,
24、 join,
路径拼接,注意事项:
- 可拼接2个或着多个路径,第一个称为初始路径,如果各组件名首字母不包含
/或\,则函数会自动加上\。提醒,如果利用自动加入的话,/和\是不统一的。- 初始路径可识别的符号,
字符串 识别后的 ./data./data/data/data\\data\data\data\data
3. 如果拼接在后的参数中含有’‘开头的参数,将从’'开头的参数开始,前面的参数均将失效
3.如果最后一个组件为空,则生成的路径以一个\分隔符结尾
25、 ‘lexists’,
26、 ‘normcase’,
27、 ‘normpath’,
28 、 ‘os’,
29、 ‘pardir’,
30、 ‘pathsep’,
31、 ‘realpath’,
32、 ‘relpath’,
33、 ‘samefile’,
34、 ‘sameopenfile’,
35、 ‘samestat’,
36、 ‘sep’,
37、 ‘split’,
38、 ‘splitdrive’,
39、 ‘splitext’,
40、 ‘stat’,
41、 ‘supports_unicode_filenames’,
42、 ‘sys’
边栏推荐
- 【软考 系统架构设计师】软件架构设计⑥ 软件产品线
- Photoshop插件-charIDToTypeID-PIStringTerminology.h-不同值的解释及参考-脚本开发-PS插件
- 一文搞懂│XSS攻击、SQL注入、CSRF攻击、DDOS攻击、DNS劫持
- R语言ggplot2可视化:基于aes函数中的fill参数和shape参数自定义绘制分组折线图并添加数据点(散点)、设置可视化图像的主题为theme_gray
- [C language] Dynamic memory management
- 【低代码】1405- 浅谈低代码平台远程组件加载方案
- C语言小项目 -- 扫雷游戏完整代码(递归展开 + 选择标记)
- Qt的简易日志库实现及封装
- 数据解析(XPath、BeautifulSoup、正则表达式、pyquery)
- HackTheBox | Previse
猜你喜欢
![[Redis] Redis installation and use of client redis-cli (batch operation)](/img/08/34f2c1cda8992e20ecd28b26d1e66a.png)
[Redis] Redis installation and use of client redis-cli (batch operation)

C language small project - complete code of minesweeper game (recursive expansion + selection mark)

Review: What is the pre-approval of autumn recruitment?What is an ordinary autumn move?It's all recruitment, why do you need to set these two recruitment time periods?

连锁小酒馆第一股,海伦司能否梦圆大排档?

“自降估值”3个亿的咖啡独角兽要IPO了

MySQL的索引和事务

logistic回归模型—基于R

Harvard University smashes the field: DALL-E 2 is just a "glue monster", and the generation accuracy rate is only 22%

Flink1.15源码阅读——StreamGraph流图

金融行业数智化供应链管理系统:多维度评估分析供应商,赋能智能金融变革
随机推荐
暗恋云匹配匿名交友聊天系统开发
医药行业转型发展,探索数字化供应链升级之道
【Redis】位图以及位图的使用场景(统计在线人数和用户在线状态)
论文理解:“Self-adaptive loss balanced Physics-informed neural networks“
KMP Media Group South Africa implemented a DMS (Document Management System) to digitize the process, employees can again focus on their actual tasks, providing efficiency
深入浅出对话系统——任务型对话系统技术框架
MySQL database storage series (5) the InnoDB storage format
代码随想录笔记_动态规划_322零钱兑换
qsort 函数的使用及其模拟实现
String转成double等类型注意非空判断
[C language] In-depth analysis of data storage in memory
HackTheBox | Previse
Tsinghua | GLM-130B: An Open Bilingual Pre-training Model
R语言数据类型转换:基本数据类型的转换、将一种数据类型转化为另外一种数据类型
6. [opencv mouse callback event]
删库不易,跑路更难
项目动态|Apache Pulsar 2.10.1 版本介绍
C语言小项目 -- 扫雷游戏完整代码(递归展开 + 选择标记)
一桩事先张扬的网红书店倒闭案
【黑马早报】巴菲特罕见巨亏近3000亿;周鸿祎回应360不能卸载;三亚倡议酒店不变相提高房价;首个国产抗新冠口服药定价不超300元...


