0
A
回答
4
是,os.path.normpath()
摺疊冗餘分離器和高達引用。
os.path.realpath()
將路徑轉換爲規範路徑,其中包括消除'..'組件,但它也消除了符號鏈接。
1
>>> import os
>>> os.path.relpath("rep/rep2/../rep1", start="")
'rep/rep1'
>>> import os
>>> os.path.normpath("rep/rep2/../rep1")
'rep/rep1'
相關問題
- 1. 正確使用os.path和os.join
- 2. 「刪除」與「刪除」
- 3. 刪除由新[]與刪除[]
- 4. 刪除與CSS
- 5. 刪除與showErrors()
- 6. 與刪除
- 7. 刪除與ggpairs
- 8. 與刪除
- 9. 與刪除
- 10. 刪除./與browserify
- 11. 刪除與JavaScript
- 12. 刪除與jQuery
- 13. 刪除與EF6
- 14. 刪除與
- 15. 刪除與qsqlquery
- 16. 刪除與// C++
- 17. 刪除與Mouse.Event
- 18. 刪除與prependTo
- 19. 刪除與「新」
- 20. Mysql:刪除行與使用「刪除」列
- 21. 刪除帖子刪除與在軌交
- 22. 刪除與刪除[] C++運算符
- 23. Teradata全部刪除與刪除+創建
- 24. 無效()/刪除/刪除[]/realloc()與g_string_free()
- 25. 軟刪除與Laravel的硬刪除
- 26. 與刪除動態移除
- 27. 刪除文件與排除
- 28. 刪除與SWIFT 3
- 29. SQL刪除與SELECT
- 30. 刪除行與MySQL