문제

I have a 2D python List of arbitrary length. I would like to copy this list into an excel worksheet using win32com.

mylist = [["A1","B1","C1","D1"],["A2","B2"],["A3","B3","C3"]]
import win32com.client
from win32com.client import constants as c
excel = win32com.client.Dispatch("Excel.Application")
wb = excel.Workbooks.Add()
ws = wb.Worksheets.Add()

At this point is there something I could do to accomplish my task?

도움이 되었습니까?

해결책

Use the standard csv module to create a CSV file, which you can then open in Excel.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top