• Right, your actions have to stand alone, and cannot rely on globals, or external imports. All imports must happen in the def itself. That's because globals and modules get cleared.

  • @7points I did report it as #523.

  • OK. I changed the

    return pressure.CGFloatValue()


    return pressure.floatValue()

    and it works again. I still don't understand how it worked earlier.

    Thanks for pointing me in the right direction

  • @cvp : I finally went for the iCloud solution, and, after copying the database in the Pythonista3 folder, inserted in my script :

    conn = sqlite3.connect('/private/var/mobile/Library/Mobile Documents/iCloud~com~omz-software~Pythonista3/Hist.db')

    and it worked, albeit with a few preliminary quirks ("No such table", and later "No such column"…)

    Thank you very much for your help

  • I don't know of any frameworks that work on iPad with Pythonista....

    Code from neural networks and deep learning does mostly work with Pythonista and will get you going quickly. This code works good for prototyping and small networks.

  • @dgelessus thanks again!!!! That is much more elegant than the code I was using. I have now carefully gone through all the argtypes with the OpenGL function I was going to use and made sure they are correct. I have updated the code on github. Thanks!

  • @peterdougstuart thank you for the offer. I ended up doing what you did and removing everything I wasn't using and then running the script above. I was able to successfully update my app in the store using that method in addition to your added steps. Thanks again.

  • Also, I want to add that pythonista is a real big boost for me. You can't just whip out your laptop at a party and say 'hey, look I can calculate the consistency of sentences' but you can do that if you have an iphone.

  • @JonB

    Speech recognition would be for anin-app mini siri concept.

    I am on iOS 11; so thats a great tip thank you.

    If anything - I am going through start to implement class to let others have access to whatever functionality I get going; as said I am weak in Objective C so this is a really good excuse to learn more.

    Off topic but somewhat related; I've started with JavaScriptCore as it appears to be a smaller framework. I am trying to see if I can get tesseract.js to work any faster than in a webview.

  • paste the entire traceback...

    Also, be sure to quit pythonista and try again. Sometimes if you get an error after starting to import, things get into a stuck state.

  • @ark , ok. Sorry I cant be more helpful. I dont have a windows system available to me to look further.

  • I highly recommend to read Ticci's:

    iOS 11: The MacStories Review - Files And then Google for Open in Place to learn more.

    Open in Place

    To make it short, this allows you to open file from Dropbox in Pythonista for example. It also means that file is not copied to the Pythonista, but Pythonista is allowed to read / save from / to this file directly in the Dropbox location. That's the reason for in Place. By opening this file you're giving Pythonista access to modify this file, even delete it.

    External Files

    External files utilises Open in Place feature. What you see in this section is a bookmark. When you tap on it, bookmark is resolved to the real location and Pythonista opens this file. If you swipe on a file in external files section, you'll see that the destructive button title says Remove. And when you tap on it, just this bookmark is removed from Pythonista, not the original file (Dropbox location). It just stays there. Want to trash this file for real? Open Dropbox and trash it there.

    However, there's one exception, slightly different behaviour.

    EXTERNAL FILES - Top level item

    Launch Pythonista Reveal file browser Tap on Open... in EXTERNAL FILES Open any file This file appears in EXTERNAL FILES Swipe left and Remove button appears This Remove button removes bookmark, not the file from Dropbox

    Same behaviour applies to folder - if you swipe left on it and it's a top level item.

    EXTERNAL FILES - Nested item

    Launch Pythonista Reveal file browser Tap on Open... in EXTERNAL FILES Open any folder This folder appears in EXTERNAL FILES Tap on this folder in Pythonista to see the listing of files / folders under it Swipe left on folder / file and Trash button appears This Trash button trashes the file / folder for real, even in the Dropbox location

    To sum it up, there's difference between:

    Top level item - swipe left - Remove - trashes bookmark only, original file untouched Nested item - swipe left - Trash - trashed original file / folder for real

    However there're still issues and Dropbox is not the perfect example, because of #509. And some others. It needs some time to let the things settle down.

  • Some additional info ...

    Don't try to do it via NSMutableURLRequest & setValue:forHTTPHeaderField:, doesn't work, UIWebView overwrites it. When UIWebView will be replaced with WKWebView (in Pythonista), it will be much easier because of customUserAgent property.
  • Thank you all. Problem solved

  • That did it. Thanks!

  • @zrzka thanks a lot

  • @ccc thanks for fixing
    I confirm that the fix works. Will wait for the unzip automatically feature

  • That error means that you sent a string to your callback, rather than a view.
    I'd bet when you were calling
    switch_1('switch1') instead of switch_1(v['switch_1']).

    It is usually helpful to look at, and paste the full traceback, to see where errors occured.
    If the ui debugger pops up, you can actually look at the variables at each level of scope, and see where the problem happened, and can walk up the call chain to see where things were called. Pressing Print Traceback prints a full traceback, which is what you should always include whenever you are asking for help on the forum.

    Learning to debug is a important skill, since it means you will be able to diagnose most problems without the delay of forum posting back and forth. (Thats why i was trying to ask leasing questions, rather than post a solution). If I can offer a few suggestions for effective debugging:

    First, find out what line threw the exception. That's key, since if you don't know where the error is, how can you fix it. Printing the traceback will tell you this, and the sequence of function calls that got you to that point.

    Next, make sure you understand what the error is telling you. AttributeErrors mean you tried to access an attribute that doesn't exist. Usually that means the object you have is not the one you expected -- for instance, when switch_1 is called with a string, instead of as ui.Switch.

    Often the pythonista debugger will then let you walk up and down the stack, and examine variables in simple structures. Expand the window, then click on variables tto examine variable values. The switch to the stack view, and you can swicth to the callers scope, and look at variables in that scope, etc. The pythonista debugger is somewhat limited (cannot evaluate arbitrary expressions), but is easy to use and for every one of your problems here would have provided good insight.

    As a crude, but easy and effective debugging technique, add print statements at key places in the code before your error. For instance, if you had print(fmt) in your old code, you would have noticed that you were being sent a ui.Switch, and not a boolean or string. If you are getting an AttributeError on somevariable, print(somevariable), print(type(somevariable)), and print(dir(somevariable)) can help you understand what you are dealing with.

    Eventually, you will want to learn how to use pdb.pm() for debugging problems after the fact, or pdb.settrace() for setting breakpoints. This is a slightly more advanced topic, but only sort of -- when I was learning python, after the basics, one of the first things i taught myself was the debugger!

  • The links should work correctly in the in-app documentation. For reading online, I'd recommend the official matplotlib docs for now.

Internal error.

Oops! Looks like something went wrong!