You need to do one of the following:
- make ex_a a class attribute by changing it to be "self.ex_a". Then it can be used from anywhere within the class
- pass it to the slot (ex_evaluator) using lambda or functools.partial
For the second option, I wrote a tutorial that describes both ways of doing this: http://www.blog.pythonlibrary.org/2013/04/10/pyside-connecting-multiple-widgets-to-the-same-slot/
To use a lambda, do something like this:
self.answer_lineEdit.returnPressed.connect(lambda ans=ex_a: self.ex_evaluator(ans))
For the functools.partial, it would be something like this:
import functools
callback = partial(self.ex_evaluator, ex_a)
self.answer_lineEdit.returnPressed.connect(callback)
If you don't understand that last one, you might want to take a look at the documentation.