'How to rename the sheet name in the spread-sheet using Python?

Have a scenario where I wanted to change the name of the "Sheet" in the spread-sheet.

a. I tried created a spread-sheet saying ss = Workbook(). Think, this is creating the spread-sheet with a sheet named "Sheet"

b. I tried changing the name of the sheet using the below format,

ss_sheet = ss.get_sheet_by_name('Sheet')
ss_sheet.Name = 'Fruit'

But then the above step is not changing the sheet name as required. Is there anything wrong in the above step ? Kindly comment on the same.

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source