why is my python code returning text:'my string' instead of just my string?
问题 my code snippet looks like this: for current_row in range(worksheet.nrows): fname_text = worksheet.row(current_row)[0] lname_text = worksheet.row(current_row)[1] cmt = worksheet.row(current_row)[2] print (fname_text, lname_text, cmt) this prints: text:'firstname' text:'lastname' text'the cmt line' i want it just to return: firstname lastname the cmt line what do i need to change to make this happen? 回答1: That's what Cell objects look like: >>> sheet.row(0) [text:u'RED', text:u'RED', empty:'']