Opening csv file in Python using Flask

The file is already open. open takes a string filename and created an open file object, but you don’t need to do that because objects in request.files are already open file-like objects.

portfolios = csv.DictReader(request.files['portfolios'])

Leave a Comment