lf_csv.py: open a file and attach data

This commit is contained in:
Nikita Yadav
2022-05-09 17:54:47 +05:30
committed by shivam
parent a08bd563ae
commit 097cb77062

View File

@@ -22,6 +22,7 @@ INCLUDE_IN_README
import pandas as pd
from pandas import *
from csv import reader
import csv
class lf_csv:
def __init__(self,
@@ -65,7 +66,13 @@ class lf_csv:
print(row)
lst .append(row)
print("list", lst)
return lst
return lst
def open_csv_append(self, fields, name):
# fields = ['first', 'second', 'third']
with open(str(name), 'a') as f:
writer = csv.writer(f)
writer.writerow(fields)
def main():
test = lf_csv()
test.generate_csv()