Hi,
I am using below code to create an Excel file. I have copied the code from below website.
This code is working however files are saved at a default path. How do I provide path to save the file. Can anyone please help me in this.
Writing to an excel
sheet using Python
import xlwt
from xlwt import Workbook
Workbook is created
wb = Workbook()
add_sheet is used to create sheet.
sheet1 = wb.add_sheet(‘Sheet 1’)
sheet1.write(1, 0, ‘Sachin’)
sheet1.write(2, 0, ‘Brian’)
sheet1.write(3, 0, ‘Rahul’)
sheet1.write(4, 0, ‘Anil’)
sheet1.write(5, 0, ‘Robin Singh’)
sheet1.write(0, 1, ‘Sachin’)
sheet1.write(0, 2, ‘Brian’)
sheet1.write(0, 3, ‘Rahul’)
sheet1.write(0, 4, ‘Anil’)
sheet1.write(0, 5, ‘Robin Singh’)
#How do I add folder path here
wb.save(‘Added by Python.xls’)