简体   繁体   中英

How to update and delete csv data in a flask website

I'm a beginner in Flask and would like to know how to update and delete csv data using a flask website. My csv Database is: name

Mark Tom Matt

I would like to know how I could add, update, and delete data on a csv file using a flask website.

Try out pandas

# Load the Pandas libraries with alias 'pd' 
import pandas as pd 

# Read data from file 'filename.csv' 
data = pd.read_csv("filename.csv") 

# Preview the first 5 lines of the loaded data 
data.head()

Check out more here pandas

Why do you need to storing or processing of data into a CSV file? Probably you will need to conditional CRUD. Looks like very troublesome way.

You may use SQLite or similar databases that more efficiently way instead of a CSV file. SQLite

Even so if you are determined to use a CSV file maybe it helps. CRUD with CSV

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM