Home > other >  About memoryerror
About memoryerror

Time:10-18

I use the openpyxl create XLSX file and write data to it, when performing the following code:
 
Ws_gzff=wb. Create_sheet (title='salary system hair _ salary extends watch _ % s' % (nd), index=0)
Execresult_array=[]
Rowcount=1
For a in cursor_oracle:
Rowcount +=1
Execresult_array. Append (a)
Gzff_title=[I [0] for I cursor_oracle. In the description] # read table field name
# traverse table fields, insert the table fields excle table ws tag header,
For I, the description in enumerate (gzff_title) :
Ws_gzff. Cell (row=1, the column=1 + I). The value=https://bbs.csdn.net/topics/description # to excle table ws_gwksk tags into the header, namely table field
# read table record to excel
# for the first row has been inserted into the field, so the table records from the second line to insert
For rowNum in range (2, rowcount + 1) : # lines
For columnNum in range (1, len (gzff_title) + 1) :
Cell=ws_gzff. Cell (rowNum=row, column=columnNum)
cell.value=https://bbs.csdn.net/topics/execresult_array [rowNum - 2] [] columnNum - 1

Prompt MemoryError error, as follows:
The Exception in the thread thread 1:
Traceback (the most recent call last) :
The File "C: \ Python35-32 \ lib \ threading py", line 914, in _bootstrap_inner
The self. The run ()
File "C: \ Users \ zhwlyfx \ Desktop \ fiscal management system data standardization. Py", line 148, in the run
Result=frame. GKJZZF_TO_EXCEL (systempassword user_yw, dw, exportdir)
File "C: \ Users \ zhwlyfx \ Desktop \ fiscal management system data standardization. Py", line 10638, in GKJZZF_TO_EXCEL
Cell=ws_zfsq. Cell (rowNum=row, column=columnNum)
The File "C: \ Python35-32 \ lib \ site - packages \ openpyxl \ worksheet \ worksheet py", line 238, in the cell
Cell=self. _get_cell (row, column)
The File "C: \ Python35-32 \ lib \ site - packages \ openpyxl \ worksheet \ worksheet py", line 253, in _get_cell
Self. _add_cell (cell)
The File "C: \ Python35-32 \ lib \ site - packages \ openpyxl \ worksheet \ worksheet py", line 264, in _add_cell
Self. _cells [(row, column)]=cell
MemoryError

Excuse me. What do I want to capture this MemoryError error, how to capture ah, in that statement USES the try

CodePudding user response:

Solved, it is ok to install 64 - bit python
  • Related