1.获取当前文件所在路径

basedir = os.path.dirname(__file__)
print("basedir:" + basedir)

2.将路径进行拼接
upload_path = os.path.join(basedir, "static/upload", filename)

相关文章:

  • 2021-05-04
  • 2021-09-03
  • 2022-12-23
  • 2022-03-08
  • 2021-12-24
  • 2021-09-13
  • 2021-08-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-07-04
  • 2022-01-20
相关资源
相似解决方案