• omz

    Flask's auto-reloader doesn't work in Pythonista because it would require spawning subprocesses which isn't possible on iOS.

    You can pass use_reloader=False to app.run() though, and debugging should still work.

    posted in Pythonista read more
  • omz

    It's actually not necessary to construct a file:// URL yourself, you can simply pass an absolute file path (i.e. os.path.abspath('base.html')) to load_url, and it'll be converted to a URL internally.

    Naïvely concatenating 'file://' + path can lead to problems when your path contains spaces etc.

    posted in Pythonista read more
  • omz

    Yes, here's an example: pythonista://SomeFolder/Script.py?action=run.

    posted in Pythonista read more
  • omz

    One problem is that you cannot convert an empty string ('') to a number, so the last conversion of income (when you press enter) will fail. You could move the if statement (if income == ' ') above the addition to avoid this issue. You should also check for an empty string there, not one space.

    The next issue you'll encounter will be that the final print will raise a TypeError ("Can't convert 'float' object to str implicitly"). This is because sum is a number after your loop and you cannot add numbers and strings. Possible solution: print('Your total income is:' + str(sum).

    posted in Pythonista read more
  • omz

    It's hard to say without seeing your code. It could be that the widget is running out of memory (it gets far less from the system than the main app), or that you've run into a bug. Certain modules/functions are not supported in the widget, but usually this should raise an exception instead of crashing. Again, without seeing your code, it's hard to tell.

    posted in Pythonista read more
  • omz

    @logang Do you have any jailbreak tweaks installed?

    posted in Pythonista read more
  • omz

    The problem is that you're creating two separate Recorder objects instead of stopping the one you've created for recording.

    This should work better:

    import speech, sound, time
    rec = sound.Recorder("audio.m4a")
    rec.record()
    time.sleep(3)
    rec.stop()
    result = speech.recognize("audio.m4a")
    print(result)
    

    posted in Pythonista read more
  • omz

    Can you post the code you've used?

    posted in Pythonista read more
  • omz

    You can't use sliders in Today widgets. As you've noticed, the system's gestures take precedence over your own controls.

    posted in Pythonista read more
  • omz

    @lsloan Example:

    from objc_util import *
    app = UIApplication.sharedApplication()
    app.openURL_(nsurl('googlechrome://apple.com'))
    

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!