Python 中相对路径

mac

publish = 'sites/publish.txt'

 

Windows:


import os
module_path = os.path.dirname(__file__)
publish = module_path + '/sites/publish.txt'

posted @ 2018-11-22 15:52 疯吻IT 阅读(...) 评论(...) 编辑 收藏