1.获取当前文件所在路径
basedir = os.path.dirname(__file__)
print("basedir:" + basedir)
2.将路径进行拼接
upload_path = os.path.join(basedir, "static/upload", filename)
原文地址:https://www.cnblogs.com/zengsf/p/9882824.html
时间: 2024-11-05 13:32:52
1.获取当前文件所在路径
basedir = os.path.dirname(__file__)
print("basedir:" + basedir)
2.将路径进行拼接
upload_path = os.path.join(basedir, "static/upload", filename)
原文地址:https://www.cnblogs.com/zengsf/p/9882824.html