Question

Well i have a question that i feel i've been answered several times, from what i found here. However, as a newbie, i can't really understand how to perform a really basic operation.

Here's the thing :

  • i have an .xls and when i use xlrd to get a value i'm just using sh.cell(0,0) (assuming that sh is my sheet);

  • if what is in the cell is a string i get something like text:u'MyName' and i only want to keep the string 'MyName';

  • if what is in the cell is a number i get something like number:201.0 and i only want to keep the integer 201.

If anyone can indicate me what i should to only extract the value, formatted as i want, thank you.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top