通过将文件名作为输入来提取文件绝对路径

问题描述 投票:0回答:1

我无法通过提供文件名(文件名)作为输入来撤回文件的路径。我该如何解决这个问题

我搜索了很多例子并没有得到解决方案,请帮我找到它的解决方案并帮助我解决这个问题

python module path operating-system absolute
1个回答
0
投票
import os
myFile = os.path.abspath('FileName')
print(myFile)
© www.soinside.com 2019 - 2024. All rights reserved.