Upload CSV file using Python Flask and process it
问题 I have the following code to upload an CSV file using Python FLASK. from flask_restful import Resource import pandas as pd ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) class UploadCSV(Resource): def post(self): files = request.files['file'] files.save(os.path.join(ROOT_PATH,files.filename)) data = pd.read_csv(os.path.join(ROOT_PATH,files.filename)) print(data) api.add_resource(UploadCSV, '/v1/upload') if __name__ == '__main__': app.run(host='localhost', debug=True, port=5000) This