-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexport_client.py
More file actions
36 lines (29 loc) · 981 Bytes
/
export_client.py
File metadata and controls
36 lines (29 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'''
# @ Author: Daniel Raimundo (DR)
# @ Create Time: 2021-07-09 08:19:37
# @ Modified time: 2021-07-09 08:26:22
# @ Description:
'''
import xlsxwriter
import csv
class exportClientXlsx:
def init(self,filename):
self.filename = filename
self.workbook = xlsxwriter.Workbook('{:s}'.format(filename))
self.worksheet = self.workbook.add_worksheet()
self.row = 0
def writeRow(self,writeList):
for col, data in enumerate(writeList):
self.worksheet.write(self.row,col,data)
self.row += 1
def close(self):
self.workbook.close()
class exportClientCsv:
def init(self,filename):
self.filename = filename
self.csvFile = open('{:s}'.format(filename), mode='w', newline='')
self.writer = csv.writer(self.csvFile)
def writeRow(self,writeList):
self.writer.writerow(writeList)
def close(self):
self.csvFile.close()