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.
I’m not smart and need help
-
Can I change the value of a variable in a function called by a button?
I tried it like this but it does not work sadly
“ UnboundLocalError: local variable 'x' referenced before assignment”
import ui x = 100 def action1(sender): x -= 1 view = ui.load_view() button = view["button1"] button.action = action1 view.present('sheet')
-
@Checkmate try this
def action1(sender): global x x -= 1 sender.superview.name = str(x)