파이썬 엑셀처리


1. xlrd (읽기전용)

홈페이지 : http://www.lexicon.net/sjmachin/xlrd.htm

import xlrd
wb = xlrd.open_workbook("c:/Book1.xls")
sh = wb.sheet_by_index(0)

print wb.nsheets, wb.sheet_names()
print sh.name, sh.cell_value(0,1)

2. pywin32 (읽기/쓰기 - COM 이용)

홈페이지 : https://sourceforge.net/projects/pywin32/
from win32com.client import Dispatch
xl = Dispatch("Excel.Application")
wb = xl.Workbooks.Open("c:/Book1.xls")
sh = wb.Sheets[0]
sh.Cells(2,1).Value = 'pywin32'

print wb.name, sh.name, sh.cells(1,2).value

wb.save
wb.close
xl.quit()
del xl

댓글

이 블로그의 인기 게시물

어쩌다 마주친 spring Error

nginx 설정정리

이클립스에서 톰캣 publish할때 에러