mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-16 01:54:53 +00:00
lf_csv.py: open a file and attach data
This commit is contained in:
@@ -22,6 +22,7 @@ INCLUDE_IN_README
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
from pandas import *
|
from pandas import *
|
||||||
from csv import reader
|
from csv import reader
|
||||||
|
import csv
|
||||||
|
|
||||||
class lf_csv:
|
class lf_csv:
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
@@ -65,7 +66,13 @@ class lf_csv:
|
|||||||
print(row)
|
print(row)
|
||||||
lst .append(row)
|
lst .append(row)
|
||||||
print("list", lst)
|
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():
|
def main():
|
||||||
test = lf_csv()
|
test = lf_csv()
|
||||||
test.generate_csv()
|
test.generate_csv()
|
||||||
|
|||||||
Reference in New Issue
Block a user