Python的os.path.expanduser(path)如何使用

本篇內(nèi)容介紹了“Python的os.path.expanduser(path)如何使用”的有關(guān)知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!

宜章ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為成都創(chuàng)新互聯(lián)公司的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18982081108(備注:SSL證書合作)期待與您的合作!

Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.>>> import os>>> path = r"F:\python官方文檔\python-3.7.9-docs-pdf-a4\docs-pdf\library.pdf">>> >>> os.path.expanduser(path)'F:\\python官方文檔\\python-3.7.9-docs-pdf-a4\\docs-pdf\\library.pdf'>>> path = r"~F:\python官方文檔">>> os.path.expanduser(path)'F:\\python官方文檔'>>> path = "F:/python官方文檔/python-3.7.9-docs-pdf-a4/docs-pdf/library.pdf">>> >>> path'F:/python官方文檔/python-3.7.9-docs-pdf-a4/docs-pdf/library.pdf'>>> os.path.expanduser(path)'F:/python官方文檔/python-3.7.9-docs-pdf-a4/docs-pdf/library.pdf'>>> >>> path = "python官方文檔/python-3.7.9-docs-pdf-a4/docs-pdf/library.pdf">>> os.path.expanduser(path)'python官方文檔/python-3.7.9-docs-pdf-a4/docs-pdf/library.pdf'>>> path = "~python官方文檔/python-3.7.9-docs-pdf-a4/docs-pdf/library.pdf">>> os.path.expanduser(path)'C:\\Users\\python官方文檔/python-3.7.9-docs-pdf-a4/docs-pdf/library.pdf'>>> >>> path = "~userpython官方文檔/python-3.7.9-docs-pdf-a4/docs-pdf/library.pdf">>> os.path.expanduser(path)'C:\\Users\\userpython官方文檔/python-3.7.9-docs-pdf-a4/docs-pdf/library.pdf'>>> >>> os.path.expanduser('~')'C:\\Users\\chenxuqi'>>> os.path.expanduser('~aaa')'C:\\Users\\aaa'>>> >>> >>> os.path.expanduser('~user')'C:\\Users\\user'>>> os.path.expanduser('~chenxuqi')'C:\\Users\\chenxuqi'>>> os.path.expanduser('~')'C:\\Users\\chenxuqi'>>> os.path.expanduser('~ ')'C:\\Users\\ '>>> os.path.expanduser('~user')'C:\\Users\\user'>>> >>>

“Python的os.path.expanduser(path)如何使用”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實用文章!

本文題目:Python的os.path.expanduser(path)如何使用
文章分享:http://bm7419.com/article14/gocode.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)建站、網(wǎng)站營銷自適應(yīng)網(wǎng)站、云服務(wù)器、動態(tài)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站建設(shè)網(wǎng)站維護(hù)公司