← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #645294]: error in reading Text file

 

Question #645294 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/645294

    Status: Open => Needs information

RaiMan requested more information:
the function str() is not needed, because you already get strings from
the file

f = open("c:/tool/Text2.txt", "r")
sumlist = []
for line in f.readlines():
    sumlist.append(line.strip()) # get rid of leading/trailing whitespace
    print (line)
f.close()
kk = sumlist[0]
popup(kk)
if kk == "Done":
    popup("Wrong Database is created Fill all required cell in Excel and run tool again", "DataBase" )
    exit(1)
else:
    #call some function

... but I do not understand your question:
This script will always exit, if 1st line is "Done", no matter how many lines follow.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.