Hi all,
I’m extremely new to python and coding in general. I am trying to create a fairly simple app to clock in and out for work purposes. I have the ui show my “time card” which I want to have a running digital clock at the top of the screen. I can get the time and have it update every second but am having issues sending the string to an (any) object in my ui. Perhaps I’m not using the correct object to display my string or not using the correct code to send it. The error I keep getting is “ui.View” object does not support item assignment. My code looks something like this:
```
import ui
import time
def change_view(sender):
'@type sender: ui.Button'
#get button name:
b = sender.name
v = ui.load_view(b)
return v.present()
@ui.in_background
def update_time():
while True:
time.sleep(1)
v1['clock_view'] = time.strftime('%r')
v1 = ui.load_view('time_card')
update_view()
v1.present() ```