import bge
cont = bge.logic.getCurrentController()
obj = bge.logic.getCurrentScene().objects
dict = bge.logic.globalDict
obj['txt_formula'].resolution = 5
formula = obj['txt_formula']['Text']

enter = cont.sensors['enter_key']
np = cont.sensors['np_key']

if enter.positive or np.positive:
    cont.activate(cont.actuators['msg'])
    dict['formula'] = obj['txt_formula']['Text']

import bge
cont = bge.logic.getCurrentController()
obj = bge.logic.getCurrentScene().objects
dict = bge.logic.globalDict
obj['txt_formula'].resolution = 5
formula = obj['txt_formula']['Text']

enter = cont.sensors['enter_key']
np = cont.sensors['np_key']

if enter.positive or np.positive:
    cont.activate(cont.actuators['msg'])
    dict['formula'] = obj['txt_formula']['Text']
