← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #218604]: problem in validation of integer

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
empID = "123456"

if len(empID) > 3 and len(empID) < 9:
     print "empID ok"
else:
     print "empID should have 4 to 8 digits"

to check it is a number:

try:
    print "empID is:", int(empID)
except:
    print "empID not numbers only"

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