There is probably a way to read out the pressure sensor and the pedometer of the iPhone 6 using 1.6 beta's ctypes module. However, I understand too little of the API to get this from CMAltitudeData and CMPedometerData. Sample code for learning how such (or similar) tasks could be accomplished would be much appreciated.
Latest posts made by DrNo152
CoreMotion data such as pressure and pedometer with 1.6 beta and ctypes?
how to give focus to a textfield in the "Custom UI" action
Is there a way to give focus to a textfield in the "Custom UI" action other than manually tapping to it if it pops up? That is, I would like to tell the action to let the cursor blink and to show the keyboard right from the start.
RE: how to give focus to a textfield in the "Custom UI" action
Great, thanks. That does the job.
Bug report: pre ios7-style magnifying glass used in editor
In the editor the magnifying glass for making selections appears to be still of pre ios7-style. The new one is used for editing file names, though.
problems using Image.open with png file
The following code
from PIL import Image img = Image.open('test.png') img.show()
IOError: broken data stream when reading image file". Reading the image from the camera roll works flawlessly, though:
import photos img = photos.pick_image() img.show()
The first image prints as
<PIL.PngImagePlugin.PngImageFile image mode=RGBA size 152x152 at 0xDFB438C>
the second one as
<Image.Image image mode=RGBA size 152x152 at 0xDFB460C>
PIL.PngImagePlugin.PngImageFileis a subclass of
Image.Imageand things like
img.show()should work in both cases. In fact, nothing seems to work with the first
A quick peruse of google seems to suggest that this might be caused by a
PS: It used to work with Pythonista 1.3.
RE: problems using Image.open with png file
img.formatis set to 'PNG'.
Your code, however, is a working fine and can be used to create a new .png file that can successfully be dealt with. Kind of weird, though. Why wouldn't it work if saved directly by a dropbox sync?
Thanks for the workaround, ccc.
RE: Action menu entry 'Run selected lines'?
Thanks for changing this in 1.4. The following simple action does now the trick:
# run selected lines import editor import console text = editor.get_text() selection = editor.get_line_selection() selected_text = text[selection:selection] exec selected_text in globals(), locals() console.hud_alert('finished','success',0.5)