• DrNo152

    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.

    posted in Pythonista read more
  • DrNo152

    Is it possible to bypass the iOS "Open in..." menu (called by 'console.open_in') if the bundle identifier 'com.xxx.yyy' of the app to be opened is known? (The app I want to open does not have an url-scheme...)

    posted in Editorial read more
  • DrNo152

    Thanks for the info. Too bad...

    posted in Editorial read more
  • DrNo152

    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.

    posted in Editorial read more
  • DrNo152

    Great, thanks. That does the job.

    posted in Editorial read more
  • DrNo152

    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.

    posted in Pythonista read more
  • DrNo152

    The following code

    from PIL import Image
    img = Image.open('test.png')
    img.show()
    

    throws "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>
    

    But PIL.PngImagePlugin.PngImageFile is a subclass of Image.Image and things like img.show() should work in both cases. In fact, nothing seems to work with the first img.

    A quick peruse of google seems to suggest that this might be caused by a libjpeg version problem.

    PS: It used to work with Pythonista 1.3.

    posted in Pythonista read more
  • DrNo152

    Yes, img.format is 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.

    posted in Pythonista read more
  • DrNo152

    How would one code a script that would work like the menu entry 'Run selected lines' in IEP when called as an action menu entry from the editor? All definitions made in the snippet should be referable in the console afterwards.

    posted in Pythonista read more
  • DrNo152

    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[0]:selection[1]]
    exec selected_text in globals(), locals()
    
    console.hud_alert('finished','success',0.5)

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!