【发布时间】:2012-03-05 12:01:14
【问题描述】:
import os
A = os.path.join(os.path.dirname(__file__), '..')
B = os.path.dirname(os.path.realpath(__file__))
C = os.path.abspath(os.path.dirname(__file__))
我通常只是将它们与实际路径硬连接起来。但是这些语句在运行时确定路径是有原因的,我真的很想了解os.path 模块,以便我可以开始使用它。
【问题讨论】:
标签: python