Get full path of argument
This question already has an answer here:
好的,我找到了答案:
import os
path = ""
if os.path.exists(sys.argv[1]):
path = os.path.abspath(sys.argv[1])
else:
print("Cannot find " + sys.argv[1])
exit()
print(path)
链接地址: http://www.djcxy.com/p/7310.html
下一篇: 获得参数的完整路径