• JonB

    What path are you trying to cd to? Im not sure if iCloud is a normal folder, or if it is, it will be located in ~/Library/MobileDocuments

    posted in Pythonista read more
  • JonB

    There is an attribute, maybe only in objc, clipstoBounds, which defines whether a views contents spill out past the edge of it's bounds. I forget if the python ui.Views have clips_to_bounds.

    posted in Pythonista read more
  • JonB

    Discussion
    Returns YES if the synthesizer is speaking or has utterances enqueued to speak, even if it is currently paused. Returns NO if the synthesizer has finished speaking all utterances in its queue or if it has not yet been given an utterance to speak.

    So if you want to know when speaking stops, one would want to check if not speaking, or speaking and paused.

    Because of threading and such, it might be more reliable to implement the delegate, and then keep track of state within the delegate object, that can then be queried in python code.

    posted in Pythonista read more
  • JonB

    Haven't tried, but often objc_util.on_main_thread fixes problems like is_paused not reporting correct no values.

    Note is_speaking will return true even if paused...

    posted in Pythonista read more
  • JonB

    You aren't wrong... I thought he meant today widget. I guess I don't know if today widgets run when.locked?

    posted in General Discussion read more
  • JonB

    Everything on your list is doable in pythonista. Widgets are also supported, though there are limitations on memory that limit somewhat of what you can do with today widgets. Shortcuts can also launch pythonista scripts.

    Most native frameworks can also be accessed via the objc_util module -- though this can be fairly difficult until you gain familiarity with both objc_util, ctypes and the frameworks in question.

    The code will be totally different on Android -- the nativey things in iOS use nativey modules in pythonista. Android speech modules won't work in pythonista, and vice versa for instance.

    posted in General Discussion read more
  • JonB

    Are you trying to write JavaScript? Or markdown?

    Iirc markdown is directly support we in pythonista. For a programming language, I'm not sure that autocorrect is ever appropriate?

    posted in Pythonista read more
  • JonB

    I don't think it is possible. There used to be a way to check if you are on wifi or mobile, maybe still is, then your net code could decide what to do, but I don't think you can enforce it via objc.

    posted in Pythonista read more
  • JonB

    I don't think webbrowser has proxy support. See https://forum.omz-software.com/topic/3708/use-objc_util-and-nsurlconnection-to-make-a-get-request/5 for a way to use lower level requests.

    From what I read, WKWebView cannot be made to use an NSUrlSession, but maybe @mikael knows. You could probably implement a callback that uses the above retrieve the content, then uses load_html to display.
    @mikael, does WKWebView support

    posted in Pythonista read more
  • JonB

    @pavlinb in fairness, wget is not a python command, why would you expect it to work in a jupyter notebook on a non *nix system? (!wget tries to call out to the shell, which of course iOS does not have)

    The python equivalent would be:

    import urllib.request
    url-variable = 'https://adress'
    urllib.request.urlretrieve(url, filename-variable)
    

    posted in Pythonista read more
  • JonB

    Someone, maybe @mikael or @polymerchm used to have a pyui editor, which let you change the heirarchical relationship of UI.Views.

    Pyui's are just json files, so you can also just edit them directly.

    posted in Pythonista read more
  • JonB

    That thread was yours ;)

    Make sure you are doing it on_main_thread, and for whatever reason a c_void_p seems more robust than py_object restype.

    posted in Pythonista read more
  • JonB

    pyObject() works, but you have to manually set the restype/argtypes. If the view is visible, I think you are guaranteed that it has not been gc'd, though any callbacks need to be careful to import what it needs explicitly within the callback, since module level imports may have been cleared. Also, callbacks should not use any globals.

    posted in Pythonista read more
  • JonB

    Use wifi. Bluetooth is sort of unreliable in pythonista, in my experience. Sometimes things disconnect for no obvious reason. Sometimes peripherals are not detected second time around. etc.

    posted in Pythonista read more
  • JonB

    I guess I don't understand the reason not to use wifi... You can talk to more than one device on wifi, why would you lose access? Bluetooth communication is really annoying.

    posted in Pythonista read more
  • JonB

    Bluetooth in pythonista is tricky, especially with multiple devices. Since cb module doesn't expose all of the delegate input args, you often cannot tell which peripheral is calling back.

    posted in Pythonista read more
  • JonB

    FWIW:

    from ui import *
    from objc_util import *
    uiimage=ObjCClass('UIImage')
    v=Image.named('test:Lenna')
    u=uiimage.systemImageNamed_('lessthan.circle')
    v.objc_instance._setImageAsset_(u.imageAsset())
    

    Leading underscore did the trick, iPadOS 13.1.3.
    Maybe not the most future proof, but does the job...

    posted in Pythonista read more
  • JonB

    @mikael @cvp have you tried setting customWords attrib of the request? Or, turn off usesLanguageCorrection? (Since the language is en-US you DON'T want language correction when trying to detect other languages!)

    I gather they are looking for words you'd find in an English dictionary. So perhaps façade, or tête-à-tête might recognize, while other examples wouldn't?

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!