• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

My python print is returning: text:'my string/text' instead of: my string/text

dalearyous

Senior member
Code:
fname_text = worksheet.row(current_row)[0]
print (str(fname_text))

this returns my text from the excel cell like this: text:'my string/text' ... i don't want the text:' part.

what can i do to just make it return: my string/text
 
You shouldn't be calling str() unless you specifically want to convert a non-string object into a string representation. If the type of fname_text after the assignment is 'str' or 'unicode' then drop the str() call and just print it.

Edit: ah wait, read this again. You're probably getting back a cel object or something. See if it has a property to access the text as a string (you can do dir(fname_text) in the shell to see its properties and methods).
 
Last edited:
Back
Top