麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁(yè) > 編程 > Python > 正文

Python中os.path用法分析

2020-02-23 06:19:33
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

本文實(shí)例分析了Python中os.path用法。分享給大家供大家參考。具體如下:
代碼如下:#coding=utf-8
import os
print os.path.abspath("d://new//test.txt")
print os.path.basename("d://new//test.txt")
print os.path.dirname("d://new//test.txt")
print os.path.exists("d://new")
print os.path.lexists("d://new")
print os.path.expanduser("d://new//text.txt")
print os.path.getatime("d://new")  #最后訪問(wèn)時(shí)間
print os.path.getmtime("d://new") #最后修改路徑時(shí)間
print os.path.getctime("d://new")  #創(chuàng)建時(shí)間
print os.path.getsize("d://new//")  #或許路徑的大小 字節(jié)為單位
print os.path.isabs("d://")  #是否是絕對(duì)路徑
print os.path.isfile("d://new//hello.txt")
print os.path.isdir("d://new")
print os.path.islink("d://new//hello.txt")
print os.path.join("d://new","hello.txt")
print os.path.normcase("d://new//hello.txt")
print os.path.relpath("d://new//hello.txt")  #相對(duì)路徑
print os.path.split("d://new//hello.txt")  #分離文件名
print os.path.splitdrive("d://new//hello.txt")  #分離磁盤(pán)驅(qū)動(dòng)器
print os.path.splitext("d://new//hello.txt")  #分離擴(kuò)展名
  
運(yùn)行結(jié)果:
>>>
d:/new/test.txt
test.txt
d:/new
True
True
d:/new/text.txt
1322235096.47
1322235096.47
1321610018.9
16384
True
True
True
False
d:/new/hello.txt
d:/new/hello.txt
hello.txt
('d://new', 'hello.txt')
('d:', '//new//hello.txt')
('d://new//hello', '.txt')
>>>

希望本文所述對(duì)大家的Python程序設(shè)計(jì)有所幫助。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: av观看国产 | 欧美成人高清视频 | 1级片在线观看 | 超碰97在线人人 | 91精彩在线 | 久久777国产线看观看精品 | 日韩中字在线 | 性片免费看 | 日本精品婷婷久久爽一下 | 九九热色| 成人做爰高潮片免费视频韩国 | 香蕉国产9 | 午夜久久久久 | 毛片在线免费观看完整版 | 看全色黄大色黄大片女图片 | 国产精品69久久 | 久久sp| 在线一级片 | 久久伊人精品视频 | av电影手机在线看 | 久久超| 国产91亚洲精品久久久 | 黄色免费大片 | 中国成人在线视频 | 国产成人av免费 | 偿还的影视高清在线观看 | 亚洲欧美日韩久久精品第一区 | 久久第四色| 中文字幕在线观看国产 | 三级国产三级在线 | 国产午夜电影 | 99re热视频这里只精品 | 亚洲va国产va | 免费观看黄色一级视频 | 欧美一级做性受免费大片免费 | 午夜精品成人一区二区 | 成人免费毛片一 | 免费在线观看国产精品 | 黄色网络免费看 | 日韩一级片一区二区三区 | 欧美一页 |