omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. mikeno

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 21
    • Best 0
    • Controversial 0
    • Groups 0

    mikeno

    @mikeno

    0
    Reputation
    441
    Profile views
    21
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    mikeno Unfollow Follow

    Latest posts made by mikeno

    • RE: Not sure how to combine ui with a plot

      You wrote * Another approach would be to have two views that are the same size, that both use draw() -- but only call set_needs_display on the view that needs update. *
      Could you please show an example?

      posted in Pythonista
      mikeno
      mikeno
    • RE: Not sure how to combine ui with a plot

      Hi, this is OK but the black circle is over the red one, how can we put the black circle behind as background?

      posted in Pythonista
      mikeno
      mikeno
    • RE: Correct way to call Pythonista script from within a Shortcuts workflow?

      Hi everybody, thx for helping, I’ll buy Pyto and try.

      posted in Pythonista
      mikeno
      mikeno
    • RE: Correct way to call Pythonista script from within a Shortcuts workflow?

      Thx for trying, I’ll wait!

      posted in Pythonista
      mikeno
      mikeno
    • RE: Correct way to call Pythonista script from within a Shortcuts workflow?

      Thx, the question is now if Pyto can read the barometer sensor value, below a short code which runs fine under Pythonista:

      from objc_util import ObjCInstance, ObjCClass, ObjCBlock, c_void_p
      
      pressure = None
      
      def get_pressure():
        
        def handler(_cmd, _data, _error):
          global pressure
          pressure = ObjCInstance(_data).pressure()
      
        handler_block = ObjCBlock(handler, restype=None, argtypes=[c_void_p, c_void_p, c_void_p])
      
        CMAltimeter = ObjCClass('CMAltimeter')
        NSOperationQueue = ObjCClass('NSOperationQueue')
        if not CMAltimeter.isRelativeAltitudeAvailable():
          print('This device has no barometer.')
          return
        altimeter = CMAltimeter.new()
        main_q = NSOperationQueue.mainQueue()
        altimeter.startRelativeAltitudeUpdatesToQueue_withHandler_(main_q, handler_block)
        try:
          while pressure is None:
            pass
        finally:
          altimeter.stopRelativeAltitudeUpdates()
          #print('Updates stopped.')
          return pressure.floatValue()*10
      
      pressure = get_pressure()
      print(pressure)
      
      posted in Pythonista
      mikeno
      mikeno
    • RE: Correct way to call Pythonista script from within a Shortcuts workflow?

      I just downloaded it but my trial period already expired because I probably already tried it some times ago and since I don’t know if it works, I don’t want to buy it. If you’ve it, could you try if it runs when iPad is asleep?

      posted in Pythonista
      mikeno
      mikeno
    • RE: Correct way to call Pythonista script from within a Shortcuts workflow?

      I don’t know PyTo but I will try, thx in any case

      posted in Pythonista
      mikeno
      mikeno
    • RE: Correct way to call Pythonista script from within a Shortcuts workflow?

      @cvp I’m not sure to understand what you mean, but calling a pythonista script from a shortcuts or an automation requires the iPad to be awake

      posted in Pythonista
      mikeno
      mikeno
    • RE: Correct way to call Pythonista script from within a Shortcuts workflow?

      Yes, it works but only if the iPad is awake

      posted in Pythonista
      mikeno
      mikeno
    • RE: Correct way to call Pythonista script from within a Shortcuts workflow?

      Yes but only everyday, I want to read the value of the barometer sensor every hour, I can get this value with Pythonista. I didn’t find a way to get this information in shortcuts nor in JS (scriptable).
      I found also a way to do some tasks every hour in shortcuts but I don’t find a way to get the barometer sensor value.

      posted in Pythonista
      mikeno
      mikeno