omz:forum

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

    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 7
    • Posts 12
    • Best 0
    • Controversial 0
    • Groups 0

    DrNo152

    @DrNo152

    0
    Reputation
    564
    Profile views
    12
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    DrNo152 Unfollow Follow

    Latest posts made by DrNo152

    • CoreMotion data such as pressure and pedometer with 1.6 beta and ctypes?

      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
      DrNo152
      DrNo152
    • console.open_in

      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
      DrNo152
      DrNo152
    • RE: console.open_in

      Thanks for the info. Too bad...

      posted in Editorial
      DrNo152
      DrNo152
    • 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.

      posted in Editorial
      DrNo152
      DrNo152
    • RE: how to give focus to a textfield in the "Custom UI" action

      Great, thanks. That does the job.

      posted in Editorial
      DrNo152
      DrNo152
    • 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.

      posted in Pythonista
      DrNo152
      DrNo152
    • problems using Image.open with png file

      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
      DrNo152
      DrNo152
    • RE: problems using Image.open with png file

      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
      DrNo152
      DrNo152
    • Action menu entry 'Run selected lines'?

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