File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def txt_to_xlsx(filename):
2121 file_cintent = json .load (file , encoding = 'UTF-8' )
2222 print (file_cintent )
2323 workbook = Workbook ()
24- worksheet = workbook .create_sheet ( title = 'student' )
24+ worksheet = workbook .worksheets [ 0 ]
2525 for i in range (1 , len (file_cintent )+ 1 ):
2626 worksheet .cell (row = i , column = 1 ).value = i
2727 for m in range (0 , len (file_cintent [str (i )])):
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def txt_to_xlsx(filename):
2121 file_cintent = json .load (file , encoding = 'UTF-8' )
2222 print (file_cintent )
2323 workbook = Workbook ()
24- worksheet = workbook .create_sheet ( title = 'city' )
24+ worksheet = workbook .worksheets [ 0 ]
2525 for i in range (1 , len (file_cintent )+ 1 ):
2626 worksheet .cell (row = i , column = 1 ).value = i
2727 worksheet .cell (row = i , column = 2 ).value = file_cintent [str (i )]
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ def txt_to_xlsx(filename):
2020 file_cintent = json .load (file , encoding = 'UTF-8' )
2121 print (file_cintent )
2222 workbook = Workbook ()
23- worksheet = workbook .create_sheet ( title = 'numbers' )
23+ worksheet = workbook .worksheets [ 0 ]
2424 for i in range (1 , len (file_cintent )+ 1 ):
2525 for m in range (1 , len (file_cintent [i - 1 ])+ 1 ):
2626 worksheet .cell (row = i , column = m ).value = file_cintent [i - 1 ][m - 1 ]
You can’t perform that action at this time.
0 commit comments