#!usr/bin/dev python
#utf-8
From OPENPYXL import Load_workbook
Import OS
Import Os.path
File_path = ' C:/users/hugo lester/desktop/statics.xlsx '
WS = Load_workbook (File_path)
Sheet = ws.get_sheet_by_name (' Sheet1 ')
For I in Range (1,10):
CLO = str (int (i))
#sheet [' G ' +clo] = sheet.cell[' A ' +clo].value +sheet.cell[' B ' +clo].value+sheet.cell[' C ' +clo].value+sheet.cell[' D ' + clo].value+sheet.cell[' E ' +clo].value+sheet.cell[' F ' +clo].value
#+ sheet[' B ' +clo]+ sheet[' C ' +clo]+ sheet[' D ' +clo]+ sheet[' E ' +clo]+ sheet[' F ' +clo]
#sheet [' A ' + clo].value + sheet[' B ' + clo].value + sheet[' C ' + clo].value +sheet[' D ' +clo].value+sheet[' E ' +clo].value+shee t[' F ' +clo].value
sheet[' G ' + clo] = 0
For row in range (0,6):
rownum = Chr (ord (' A ') + row)
Position = rownum + CLO
Print Sheet[position].value
#print rownum
If not Sheet[position].value is None:
sheet[' G ' + clo] = sheet[' g ' + clo].value +sheet[position].value
#print rownum
#print type (ROW)
#print type (sheet[' G ' + clo].value)
#print rownum
Ws.save (File_path)
Python Excel processing OPENPYXL