← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #237141]: how to get total number of instances of one line in sikuli?

 

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

    Status: Answered => Open

koventhan is still having a problem:
i have tried below code but still getting 1st instead only,,, not
getting all the instead in return


def ModuleType(file):
    f = open(file)
    ModuleType = ""
    for x in range (1,5):
        for line in f.readlines():
            if line.count("Module Type/SType")==0 : continue
            (head, ModuleType) = line.split(":")
            ModuleType = ModuleType.strip()
            print "%d" % (x),ModuleType
            return ModuleType

file2="C:\\Program Files\\Sikuli X\\putty.log"

ModuleType = ModuleType(file2)

print ModuleType

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.