我想从python中的文件中读取数据,并比较它是否与某些信息匹配。我有这个从文件中的字符串不匹配python中的字符串
with open("data.dat", "r") as f: #read data in from the file
for line in f:
if line is "Static": #this adds the data for the static attack
当我从我的文件中读取数据时,它跳过它。我为什么不知所措。
这是我的data.dat文件。
Static
0 10
1 50