Spaces:
Runtime error
Runtime error
xiomarablanco
commited on
Commit
·
9f530c0
1
Parent(s):
c2ed8f0
Update app.py
Browse files
app.py
CHANGED
@@ -82,15 +82,15 @@ def Main(uploadedFile, txtFileInput, orthographyPercentage, syntaxPercentage, se
|
|
82 |
|
83 |
# modelJson = json.dumps(modelResult)
|
84 |
#print(modelResult)
|
85 |
-
outputFilePath='./output/' + str(datetime.now().microsecond) + '_plentas_output.xlsx'
|
86 |
-
excelPath = exportResultToExcelFile(modelResult
|
87 |
|
88 |
except Exception as ex:
|
89 |
error = "Error exporting to Excel: " + str(ex)
|
90 |
|
91 |
return [error, excelPath]
|
92 |
|
93 |
-
def exportResultToExcelFile(modelResult
|
94 |
try:
|
95 |
excelData = []
|
96 |
|
@@ -108,8 +108,8 @@ def exportResultToExcelFile(modelResult, outputFilePath):
|
|
108 |
tableResults.json=json.dumps(excelData)
|
109 |
tableExport=tableResults.export('xlsx')
|
110 |
#outputFilePath = './output/' + str(datetime.now().microsecond) + '_plentas_output.xlsx'
|
111 |
-
|
112 |
-
with open(outputFilePath, 'wb'
|
113 |
f.write(tableExport) # write the dataset to the xlsx file
|
114 |
f.close()
|
115 |
|
|
|
82 |
|
83 |
# modelJson = json.dumps(modelResult)
|
84 |
#print(modelResult)
|
85 |
+
#outputFilePath='./output/' + str(datetime.now().microsecond) + '_plentas_output.xlsx'
|
86 |
+
excelPath = exportResultToExcelFile(modelResult)
|
87 |
|
88 |
except Exception as ex:
|
89 |
error = "Error exporting to Excel: " + str(ex)
|
90 |
|
91 |
return [error, excelPath]
|
92 |
|
93 |
+
def exportResultToExcelFile(modelResult):
|
94 |
try:
|
95 |
excelData = []
|
96 |
|
|
|
108 |
tableResults.json=json.dumps(excelData)
|
109 |
tableExport=tableResults.export('xlsx')
|
110 |
#outputFilePath = './output/' + str(datetime.now().microsecond) + '_plentas_output.xlsx'
|
111 |
+
outputFilePath = './output/plentas_output.xlsx'
|
112 |
+
with open(outputFilePath, 'wb') as f: # open the xlsx file
|
113 |
f.write(tableExport) # write the dataset to the xlsx file
|
114 |
f.close()
|
115 |
|