I want to create multiple sheets using the input function. I used the split function, but still it only creates one sheet. The idea is not to be restricted by the number of sheets.
import xlsxwriter
from xlsxwriter import workbook
workbook = xlsxwriter.Workbook('doc.xlsx')
sheetnames = input("Enter value: ").split(', ')
sheetss = []
for i in sheetnames:
sheetss.append(i)
worksheet_data = workbook.add_worksheet(i)
workbook.close()
Any ideas?
workbook.add_worksheet(i)inside theforloop?