Hello, im brand new to the forum and im looking for some help on the UI module that I couldn't find in the documentation. What I'm trying to do is build a very simple neural network that looks at a three by three grid of buttons that can be on or off then inputed to the net by pressing a "Enter Inputs" button. However this requires a "action" attached to the "Enter Inputs" that can find the current titles of all buttons on the grid (either 1 or 0), but I dont know how to access button attributes not of the "sender" especially since I can't load my .pyui file and its contents before defining the relevant functions. I've tried every iteration of the code possible moving things around even trying to access non existing subclasses but all i've got so far is this:
import ui
import neural_network
def button tapped(sender): # used by all my buttons but "Enter Inputs"
if sender.title == '0':
sender.title = '1'
elif sender.title == '1':
sender.title = '0'
def Enter_inputs_tapped(sender):
pass # dont know what too put that could access all button titles.
v = ui.load_view('NetworkUI.pyui')
v.present('sheet')
I know the answer is probally stupid simple, but I could use help. Just so you know the UI also contains a label for my eventualy output after linking this to the neural network, but is not mentioned in the current code as that appears easy and I won't worry or code that until much later. I didnt include the UI json as its fairly big and I didnt want it taking up my post when I dont think its nesessary to include. Any help or suggestion would be awesome.
Note: In case my wording or grammer was weird all I want to do is have a action attached to the button that takes the current values of the other nines buttons titles and send it to my neural network. In case you couldnt tell Im definitely an amateur.