this_loc = os.path.dirname(__file__)
print('this_loc', this_loc)
print(os.path.abspath(this_loc + '/wb_cookie'))
# exit(1)
with open(os.path.abspath(this_loc + '/wb_cookie'), 'r') as f:
cookie = f.readline().strip()
this_loc = os.path.dirname(__file__)
print('this_loc', this_loc)
print(os.path.abspath(this_loc + '/wb_cookie'))
# exit(1)
with open(os.path.abspath(this_loc + '/wb_cookie'), 'r') as f:
cookie = f.readline().strip()
本文标题:Python工程中动态获取绝对路径
本文链接:https://www.haomeiwen.com/subject/ukpahrtx.html
网友评论