Aug-21-2018, 05:00 PM
Hello Guys,
i am working on a school project and could need some help.
because i have to add even more variables and it would be way more efficent if i
could just add it to the list, instead of creating a new def.
Thanks for your help.
Greedings
Godx
i am working on a school project and could need some help.
command = [getuser(),getpw(),getnewuser(),getnewpw(),getreppw()] variable = [user,pw,newU,newpw,reppw] surce = [e1,e2,f1,f2,f3] for i in range(5) : def command[i]: global variable[i] variable[i] = surce[i].get() return variable[i]As you see i have to create lots of defs and like to shorten this,
because i have to add even more variables and it would be way more efficent if i
could just add it to the list, instead of creating a new def.
def getuser(): global user user = e1.get() return user def getpw(): global pw pw = e2.get() return pw def getnewuser(): global newU newU = f1.get() return newU def getnewpw(): global newpw newpw = f2.get() return newpw def getreppw(): global reppw reppw = f3.get() return reppw
Thanks for your help.
Greedings
Godx