• cvp

    @wreyford your error message seems to indicate that you call your own script turtle.py...and that is to be avoided because it has the same name as the imported module.

    posted in Pythonista read more
  • cvp

    @secmast try this

    import location, time
    
    a=""
    label1 = ""
    
    def getlocation():
        location.start_updates()
        time.sleep(1)
        label1 = location.get_location()    # returns a dictionnary
        location.stop_updates()
        return label1
    
    a = getlocation()
    print(a)
    # get two elements from dictinnary
    lat = a['latitude']
    lon = a['longitude']
    print(lat,lon)```

    posted in Pythonista read more
  • cvp

    I think that pick_document creates a local temporary copy of the external file.
    You could append your data to the local copy and then save the appended file into its original location via open_in.

    posted in Pythonista read more
  • cvp

    @brumm ok, no problem (I do the same a lot of unsuccessful tries and then, miracle, it works 😥)

    posted in Pythonista read more
  • cvp

    @brumm You could perhaps be interested by this (not so easy) modification to check the location while typed, without going to a map app...

    posted in Pythonista read more
  • cvp

    @brumm If you allow to specify the start/end date of the event, perhaps could you also allow to set the year (if you have enough room on the screen)

    posted in Pythonista read more
  • cvp

    @brumm I just wanted to say that my quick code was ugly (I hope @ccc didn't see it 😢), not the visual aspect.

    posted in Pythonista read more
  • cvp

    @AlanE If I correctly understood, try this

    import ui
    
    v = ui.View()
    v.frame = (0,0,500,600)
    
    sv1 = ui.View(name='sv1')
    sv1.background_color = 'white'
    sv1.frame = (0,0,v.width/2,v.height)
    v.add_subview(sv1)
    b1 = ui.Button(name='b1')
    b1.frame = (0,0,100,32)
    b1.border_width = 1
    def b1_tap(sender):
        print(sender.title)
        mv = sender.superview.superview
        sender.superview.remove_subview(sender)
        mv['sv2'].add_subview(sender)
    b1.action = b1_tap
    b1.title = 'b1'
    sv1.add_subview(b1)
    
    sv2 = ui.ScrollView(name='sv2')
    sv2.background_color = 'yellow'
    sv2.frame = (sv1.width,0,v.width-sv1.width,v.height)
    sv2.content_size = (sv2.width,2*sv2.height)
    v.add_subview(sv2)
    b2 = ui.Button(name='b2')
    b2.frame = (0,50,100,32)
    b2.border_width = 1
    def b2_tap(sender):
        print(sender.title)
    b2.action = b2_tap
    b2.title = 'b2'
    sv2.add_subview(b2)
    
    
    v.present('sheet')```

    posted in Pythonista read more
  • cvp

    @brumm Nice
    If you want to have a date-year picker, try this little (ugly) script

    import ui
    
    v = ui.View()
    v.name = 'Day Time Month Year Picker'
    v.frame = (0,0,500,500)
    v.background_color = 'white'
    
    d = ui.DatePicker()
    d.frame = (50,50,200,200)
    d.mode = ui.DATE_PICKER_MODE_DATE_AND_TIME
    d.background_color = (200,200,200,1)
    v.add_subview(d)
    
    y = ui.DatePicker()
    #y.background_color = 'lightgray'
    y.mode = ui.DATE_PICKER_MODE_DATE
    y.background_color = d.background_color
    y.frame = (50,50,300,200)
    v.add_subview(y)
    
    d.bring_to_front()
    
    v.present('sheet')```

    posted in Pythonista read more
  • cvp

    I use piexif, see here

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!