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?
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.
Latest posts made by mikeno
-
RE: Not sure how to combine ui with a plot
-
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?
-
RE: Correct way to call Pythonista script from within a Shortcuts workflow?
Hi everybody, thx for helping, I’ll buy Pyto and try.
-
RE: Correct way to call Pythonista script from within a Shortcuts workflow?
Thx for trying, I’ll wait!
-
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)
-
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?
-
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
-
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
-
RE: Correct way to call Pythonista script from within a Shortcuts workflow?
Yes, it works but only if the iPad is awake
-
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.