Hi, can someone give me some help?
I want to add an extra to the account save.
so that apart from ID and PWD, also save a pin or account security code, as you want.
The problem is that at the time of adding it. everything normal is saved with the ID and PWD but, when I want to call the account and it logs automatically.
It gives me problems, it says in sysser
0715 10: 19: 39539 :: File "introLogin.py", line 1719, in __OnClickLoginAutoButton
0715 10: 19: 39539 :: IndexError
0715 10: 19: 39539 :::
0715 10: 19: 39539 :: list index out of range
def __OnClickSaveLoginButton(self):
id = self.idEditLine.GetText()
pwd = self.pwdEditLine.GetText()
pin = self.pinEditLine.GetText()
keypw = self.__ReadSavedPassword()
pwd = self.encode(keypw, pwd)
if (len(id) == 0 or len(pwd) == 0 or len(pin) == 0):
self.PopupNotifyMessage("Por favor, escriba ID , contrasena y pin.",self.SetIDEditLineFocus)
return
try:
file_object = open("user//credentials", "a")
except:
file_object = open("user//credentials", "w")
file_object.write("{}:{};{}\n".format(id,pwd,pin))
file_object.close()
self.PopupNotifyMessage("Se guardo con exito",self.SetIDEditLineFocus)
def __OnClickLoadInfoButton(self):
self.accountList = uiSelectCredentials.FileListDialog()
self.accountList.Open()
def __OnClickLoginAutoButton(self):
file_object = open("user//preferred", "r")
credentials = file_object.readline()
credentials = credentials.split(";")
file_object.close()
self.Connect("{}".format(credentials[0]), "{}".format(self.decode(self.__ReadSavedPassword(),credentials[1]), "{}".format(credentials[2]) ))