Set Password

Asked by Hossain Abeer on 2017-07-16


I am trying to set password on starting the program. It would prompt a window, ask for a password, then do its operations. I have used the following commands:

yes = popAsk("PassWord?", "Program")
if not yes:
    popup("Please enter Valid password", "Program")

ok = input("Enter Validity Code:", "15-digit code", "Program")
input = (" ")
if not ok:

popup("Program starts now!", "Program")

Problem: The program accepts just about anything on input, and lets anyone access.

Thank you for your time
Hossain Abeer

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Solved by:
Hossain Abeer
Last query:
Last reply:
Manfred Hampl (m-hampl) said : #1

There is no logic in your program to validate the code that has been entered.

You need to compare the entered value with the desired password, something like

if ok != "TheHiddenSecret":

see also

Hossain Abeer (retroxic) said : #2

Hey Manfred,

Thanks for your respond. I have just started to code. So can you write a simple model of codes which may provide a log in portal. I have absolutely no idea on this.

Also, I have checked the link provided, but didn't find article relating to log in system.

HOssain ABeer

Manfred Hampl (m-hampl) said : #3

I do not really understand your question.
To which system do you want to log in? Doesn't that system already have its login screen?

Hossain Abeer (retroxic) said : #4

I want to create a program, using sikuli. This program would only allow a number of my colleagues to log in, using username and password. I have been able to create the program, but can't provide a log in portal for this.

Manfred Hampl (m-hampl) said : #5

Sorry, but I am not able to offer a user identification and authentication management system in sikuli.

I already made a proposal in comment #1 for a simple validation check. If that is not enough, then you have to ask somebody else.

Hossain Abeer (retroxic) said : #6

The code -

if ok != "Password":

gives an error. Error reads as "[error] NameError ( name 'ok' is not defined )"

Thank you for your effort my friend
Best wishes

Hossain Abeer (retroxic) said : #7


I have done a little research, and successfully made a simple log in portal. the code -

yes = popAsk("Have a password?", "Program")
if not yes:
    popup("Please get one", "Program")

password = input()
if password == "12543":
    popup("Thanks. Your Program starts now!", "Program")
    popup("Wrong Password. Try Again", "Program")

Thanks for viewing