My little bit of code (it's not all but I think it's all that is needed):
functions = {'1':cels_kelw, '2':cels_farh, '3':cels_kelw, '4':kelw_farh, '5':cels_farh, '6':kelw_farh}
while True:
operation = raw_input("Choose number:\n")
if operation == '7':
print 'PROGRAM ENDED'
break
try:
chosenFunction = functions.get(operation)
if (operation == '3') or (operation == '5') or (operation == '6'):
turn = 1
else:
turn = 0
print ("Result of your conversion is {num}".format(num = chosenFunction(get_float(), turn)))
except NameError:
print("Function you have chosen doesn't exists or you have put wrong type of data")
Now, when I run it in python interpreter it works well, when I am asked to choose function and it exists - there's no exception and it throws me result of the picked function.
When I converted it to .exe with py2exe it asks me to input number of function in my mind but it doesn't work. After putting number (for ex. 1) it asks me for a number again.
What's wrong with this code? Thanks for help.