Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Error message?
-
The script below is for a Simple calculator ui. When the add button is clicked, the numbers are supposed to be read from two text fields, txtX and txtY. and stored in variables x & y. (This part works.) However, I keep getting the message "unicode object is not callable" , when line 4 is implemented. Here is the code: Can someone please help?
import ui def add(sender): x = float(sender.superview['txtX'].text) #1 y = float(sender.superview['txtY'].text) #2 sum = x + y #3 sender.superview['txtOutput'].text(str(sum)) #4 ui.load_view('SimpleCalGui').present('sheet')
-
Hi @dat2357
Try making line 4 this:sender.superview['txtOutput'].text = (str(sum)) #4
The equals sign is all-important. Hope this helps!