获得参数的完整路径
这个问题在这里已经有了答案:
好的,我找到了答案:
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/7309.html
上一篇: Get full path of argument
下一篇: Check to see if a file exists, and create it if it doesn't