Tornado: Read uploaded CSV file?
问题 I want to do something like: import csv import tornado.web class MainHandler(tornado.web.RequestHandler): def post(self): uploaded_csv_file = self.request.files['file'][0] with uploaded_csv_file as csv_file: for row in csv.reader(csv_file): self.write(' , '.join(row)) But, uploaded_csv_file is not of type file . What is the best practice here? Sources: http://docs.python.org/2/library/csv.html http://docs.python.org/2/library/functions.html#open https://stackoverflow.com/a/11911972/242933 回答1