fastapi FileResponse中的問題

2021-10-05 01:22:11 字數 813 閱讀 9010

在上篇的文章使用fastapi的其他響應中,使用了一下這個fileresponse,首先遇到了下面這個問題

assertionerror: 『aiofiles』 must be installed to use fileresponse

先安裝乙個aiofiles試試

(base) d:\txc>pip install aiofiles

collecting aiofiles

downloading aiofiles-0.5.0-py3-none-any.whl (11 kb)

installing collected packages: aiofiles

successfully installed aiofiles-0.5.0

從介面文件位址上看是可以正常使用了

)這2個方法都是正常可以返回python

python中的ensure ascii問題

在使用json.dumps時要注意乙個問題 import json print json.dumps 中國 u4e2d u56fd 輸出的會是 中國 中的ascii 字元碼,而不是真正的中文。這是因為json.dumps 序列化時對中文預設使用的ascii編碼.想輸出真正的中文需要指定ensure ...

Vue vue中setInterval的問題

this.chattimer setinterval 1000 然後再元件銷毀前進行清除 beforedestroy 根據 setinterval 返回的 id 列印來看,請除定時器並沒有成功 但是這樣不行,定時器在區域性更新的時候會多次賦值.更改了一種寫法,加了一重判斷之後依舊無法解決.if th...

EXPDP Oracle expdp中並行問題

expdp hr hr tables test1 dumpfile test2.dmp directory pumpparallel 4 export release 11.2.0.4.0 production on sat jul 1 05 11 29 2017 connected to orac...