I have a pyobbc string with a value of (9,) I'm trying to read the value in a simple integer variable, and I find it so hard to do. (I'm new to python, so I will probably miss something dumb)
makes a simple int(a_row[0])
get -
TypeError: int() argument must be a string or a number, not 'pyodbc.Row'
I try to translate a string to a list first, and its result
I had to make it integer work
row_id=(2, )
temp_num=0
temp_num = [number for number in row_id[0]]
temp_num=int(temp_num[0])
I just find it really strange that I have to do something so stupid, so it must be my fault, can someone enlighten me where I got it wrong?
source
share