非常好的一天!
所以,我需要做什么,如果我有一個錯誤TypeError: 'method' object is not subscriptable in Flas
file = flask.request.files.getlist['propert_photo[]']
TypeError: 'method' object is not subscriptable
<div class="form-group">
<label for="exampleFormControlFile1">Фотографии</label>
<input name = "propert_photo[]" type="file" accept="image/png" multiple="" class="form-control-file" id="exampleFormControlFile1">
</div>
請幫忙
uj5u.com熱心網友回復:
file = flask.request.files.getlist['propert_photo[]']
應該
file = flask.request.files.getlist('propert_photo[]')
getlist是一種方法,并且方法呼叫使用()而不是[]。
Python 中的“可下標”是指您是否可以a[0]在物件上使用方括號語法(如)(或者換句話說:它是否實作了該__getitem__()方法)。事實上,方法/函式物件不支持這種語法。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/403763.html
標籤:
