• brumm

        def draw(self):
            self.iv.image.draw(0,0,self.width,self.height)
    

    you can only fit your image or you might like to calculate the screen ratio first...

    posted in Pythonista read more
  • brumm

    with Pythonista 3.2 +

    #...
            self.iv.image = ui.Image.named('lock_screen.png')
    
        def draw(self):
          self.iv.image.draw()
    #...
    

    it worked for me

    edit: btw. leave out the ImageView is also possible

    #...
            #self.iv = ImageView()
            #self.iv...
            self.image = ui.Image.named('lock_screen.png')
    
        def draw(self):
          self.image.draw()
    #...
    

    posted in Pythonista read more
  • brumm

    I don't use pytube, but youtube-dl is working pretty well for me.

    posted in Pythonista read more
  • brumm

    You only set the action function of your first button (4 times).

    b_top1.action = button_tapped
    

    In this function you need to test the self.title (SUM, DIV, ...) if you want to use it for all four operations.

    posted in Pythonista read more
  • brumm

    @cvp: For both 😄

    posted in Pythonista read more
  • brumm

    I bought the SQLed app for quick checking things. The downside is you have to "share..." the sqlite db between the apps.

    Btw. in the PythonCheatSheet is a sqlite section.

    posted in Pythonista read more
  • brumm

    import ui   #import needed library
    
    def tap(sender):   #define function before it is called
        print(sender.title)
    
    v = ui.View()
    v.frame = (0,0,400,400)
    v.name = 'test'
    
    b = ui.Button()
    b.title = 'use'
    b.action = tap
    b.background_color = 'white'
    b.border_color = 'blue'
    b.border_width = 1
    b.corner_radius = 5
    b.frame = (10,10,100,32)
    v.add_subview(b)
    
    ba = ui.Button()
    ba.title = 'buy'
    ba.action = tap
    ba.background_color = 'white'
    ba.border_color = 'blue'
    ba.border_width = 1
    ba.corner_radius = 5
    ba.frame = (110,10,100,32)
    v.add_subview(ba)
    
    v.present('sheet')
    

    ui help

    ui Tutorial

    posted in Pythonista read more
  • brumm

    app.run(debug=False)
    

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!