Im trying to read a CSV file (with one column) and convert them into Lists. The following is my code.
import csv
path = "/tmp/list.csv"
with open(path, 'r') as f:
reader = csv.reader(f)
your_list = list(reader)
print(your_list)
List.csv:
apple
banana
orange
pear
The code output:
[['apple'], ['banana'], ['orange'], ['pear']]
But do can I generate a output is the following format?
Expected output:
["apple","banana","orange","pear"]