比较两个相等变量时,程序无法识别它们相等>

时间:2019-02-07 17:13:43

标签: python

我正在比较两个我知道相等的变量,但是比较结束后发现不等于1:

asearchid=searchid.get()
asearchid=IntVar()
found = 0
with open ('competitordetails.txt','rU') as csvfile:
    reader = csv.reader(csvfile)
    for row in reader:
        compidfound = row[0]
        compidfound = IntVar()
        if(asearchid == compidfound):
            found = 1
        else:
            found = 0
print(found)

我将两个变量更改为IntVar,但仍无法正常工作

0 个答案:

没有答案