• brumm

    class User_Input_Date():
        def __init__(self):
            self.month_input = input('What was the month (1-12)')
            if self.month_input in ['01', '1', 'Jan', 'January', 'jan', 'january']:
                self.month_input = 1
            elif self.month_input in ['02', '2', 'Feb', 'February', 'feb', 'february']:
                self.month_input = 2
            elif self.month_input in ['03', '3', 'Mar', 'March', 'mar', 'march']:
                self.month_input = 3
                self.month_input = None
            self.year_input = int(input('What was the year?'))
        def printDate(self):
            print(f'year = {self.year_input} month = {self.month_input}')
    primary_bariatric_date = User_Input_Date()

    You store the variables with self.name instead returning it.

    posted in Pythonista read more
  • brumm

    button1.frame = (x, y,width,height)
    button2.frame = (x, y,width,height)

    posted in Pythonista read more
  • brumm

        def draw(self):

    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):

    it worked for me

    edit: btw. leave out the ImageView is also possible

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

    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
    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)
    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)

    ui help

    ui Tutorial

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!