• oldCovfefe

    Hello all,
    I am looking for a proven workflow to distribute a python script to others that run pythonista on IOS. Ideally I would like to only distribute .PYC compiled code without the underlying .PY source, if that is possible. I have successfully compiled my script using py_compile and it creates bytecode files in the cache. Now the question is how do you run it without the source?

    import myscript
    

    will run it, if the myscript.py is present, not so much if it's missing and only the PYC is present. I did try with both settings for "sys.dont_write_bytecode" just in case that would also affect the loading behavior. Do I need to move the PYC file from the cache to the main directory?

    Also, what's the best way to package it, so that other can unpackage it on their phones with copy/pasting source code etc.?

    Thanks much for any help you can provide.

    posted in Pythonista read more
  • oldCovfefe

    I finally found the issue. The code works fine on the main level of the app, but has these issue when triggered from a event handler (a function call from an action attribute). The following directive solves the issue:

    import location
    
    @ui.in_background
    def button_tapped(sender):
       location.start_updates()
       loc_dic = location.get_location()
       addr_dic = location.reverse_geocode(loc_dic) 
       ...
    

    posted in Pythonista read more
  • oldCovfefe

    tried that, but it only resulted in a hung loop ... there is something else funky going on, because from the console it works just fine.

    posted in Pythonista read more
  • oldCovfefe

    Code snippet:

    import location
    
    location.start_updates()
    loc_dic = location.get_location()
    addr_dic = location.reverse_geocode(loc_dic)
    

    Get location works fine, converting it to a friendly street address does not. When I enter the same statement (the last line) in the console, it works just fine and creates a dictionary with all the interesting info. Any ideas what could be going on? Is it a timing issue, meaning I have to wait until it’s populated?

    Thanks

    posted in Pythonista read more
  • oldCovfefe

    TextView brings up the standard keyboard with dictation option. It would be nice if this could be done programmatically. 1.set dictation language (locale) 2. start dictation mode. Has anyone attempted it yet?

    posted in General Discussion read more
  • oldCovfefe

    On iPad, both methods work, so I used the newer pick_asset to select pictures from the camera roll. On iPhone however, photo.pick_asset will show the camera roll thumbnails, allow to select one or more (depending on the setting of multi), but then freeze. Using pick_image seems to work, but only on pictures that have NOT been saved with Apple’s new ‘High Efficency’ format. Has anyone else run into this? Thanks.

    posted in General Discussion read more
  • oldCovfefe

    Thanks. I understand they are not the same image types, and the conversion is straight forward, but problem remains ui.ImageView as a class is not documented. I checked "?" in the console, and it's the same as online at the web site. There are only 3 items in the docs, the constructor, the image "attribute" (property) which is an ui.Image object type, and one method, i.e. load_from_url(url). There are however many other attributes, such as width, height, autosizing, alpha, background_color, etc. a lot might be inherited from iu.View() but there might be more.

    posted in Pythonista read more
  • oldCovfefe

    Hello all,
    new here. Really like Pythonista for prototyping and messing with REST Apis. Also love the idea of including iPhone/iPad specific capabilities. Working on images and photos from camera and camera roll. I see that ui.ImageView has many attributes and methods, but I cannot seem to find any doc for it. The online doc shows 2 or 3, and code complete teases me with whats available, but doesn't tell me the parameters and such. Any pointers where to get a complete reference? Thanks much.

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!