i am very new in python, i have multiple options such as 1 to 99 and i want to select 23 as an windows after pressing f2 i press 2 and 3 and then press enter, number 23 is get selected. i want to do this in ubuntu 10.04. what will be procedure? i am writting some code
def keyDown(self,e):
if e.keystring == "f2":
selectedNumber = 0
elif e.keystring == "enter":
print selectedNumber
selectedNumber =0
else:
selectedNumber +=int(e.keystring)
thanks in advance
You could store the selected number as a string and when enter is pressed convert the number to an int. More input validation would be needed, but this should give you the idea.