python – 如何清理与send_file一起使用的临时文件?

python – 如何清理与send_file一起使用的临时文件?

我正在开发一个服务器端json接口,其中几个临时文件在请求期间被操纵. 我目前在请求结束时清理这些文件的解决方案如下所示: @app.route(/method,methods=[POST])def api_entry(): with ObjectThatCreatesTemporaryFiles() as object: object.createTempora

联系我们

联系我们

0577-28828765

在线咨询: QQ交谈

邮箱: xwei067@foxmail.com

工作时间:周一至周五,9:00-17:30,节假日休息

返回顶部