How to convert a list value to int

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?

0
source share
1 answer

; (Row s) row_id[0], . , a_row[0][0] .

0

Source: https://habr.com/ru/post/1613734/


All Articles