아미(아름다운미소)

python 엑셀(excel) 다루기 본문

랭귀지/python

python 엑셀(excel) 다루기

유키공 2018. 9. 9. 08:00

A1 셀에 값 입력하기

# -*- coding: utf-8 -*- 
'''
Created on 2018. 9. 6.

@author: bhm
'''
import win32com.client

excel = win32com.client.Dispatch("Excel.Application")
excel.Visible = True
wb = excel.Workbooks.Add()
ws = wb.Worksheets("Sheet1")
ws.Cells(1, 1).Value = "hello python"
wb.SaveAs('C:\\Users\\bhm\\Desktop\\test.xlsx')
excel.Quit()


Comments