• @JeremyMH a foundation vote that proposed @enceladus but without the editor UI

    import ui class StopWatch(ui.View): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.value = 0 self.state = 'stop' self.update_interval = .1 def draw(self): t0 = (self.value // (600 * 60), self.value // 600, self.value // 10) t1 = (t0[0], t0[1] % 60, t0[2] % 60) ui.draw_string( "{:02}:{:02}:{:02}".format(*t1), font=('Helvetica', 20), rect=(150, 0, 0, 0), color='black', alignment=ui.ALIGN_CENTER) def update(self): if self.state == 'run': self.value += 1 self.set_needs_display() def button_action(sender): v1 = sender.superview['Watch'] sender.hidden = True if sender.title == 'Reset': v1.value = 0 v1.state = 'stop' sender.superview['Start'].hidden = False elif sender.title == 'Start': v1.value = 0 v1.state = 'run' sender.superview['Stop'].hidden = False elif sender.title == 'Stop': v1.state = 'stop' sender.superview['Reset'].hidden = False v = ui.View(width=397, height=271) v.add_subview(StopWatch(name = 'Watch', frame = (0, 30, 345.00, 76.00))) v.present('sheet') for btn in ['Reset', 'Stop', 'Start']: v.add_subview(ui.Button(frame=(v.center.x-40, v.center.y-40, 80, 80), name=btn, border_width=1, corner_radius=40, action=button_action)) v[btn].title = btn if btn != 'Start': v[btn].hidden = True```
  • What did you try? This works for me:

    >>> d=ui.UIDatePicker >>> d.date=datetime.datetime(2015,9,2,4,4,4) >>> d.date datetime.datetime(2015, 9, 2, 4, 4, 4)
Internal error.

Oops! Looks like something went wrong!