• JonB

    http://omz-software.com/pythonista/docs/ios/console.html

    Pythonista has a built in help, (look for the question mark icon) which also let's you search.

    posted in Pythonista read more
  • JonB

    oh, i see.

    client.run('token')

    shuld be

    bot.run('token')

    also, client.on_message, etc all become bot.on_message
    Bot is a subclass of Client -- your bot instance IS your client.

    posted in Pythonista read more
  • JonB

    could you try:

    @bot.command()
    async def test(ctx):
        await ctx.send('test')
    

    then type $test

    posted in Pythonista read more
  • JonB

    note the thread you linked to was the exact same question (wording and all) which is what tipped me off. I think there are bots that find old threads, or stack overflow questions, then repost them with a link embedded. This might be some kind of SEO (getting links out into the wild) or could be just hoping you click the link.

    posted in Pythonista read more
  • JonB

    @cvp you got tricked by a clever spam ruse. The spam hotlink was the point!

    posted in Pythonista read more
  • JonB

    @ihf see this thread:
    https://forum.omz-software.com/topic/3299/get-filenames-for-photos-from-camera-roll/19

    It is possible to get a file handle to a video asset. I haven't looked, but I suspect something might exist for photos.

    posted in Pythonista read more
  • JonB

    @cvp I suspect anchor_point would solve the offset issue...

    posted in Pythonista read more
  • JonB

    Does it crash both in the extension and in full app?

    Can you check what the crash handler says? This should be a text file in the main app folder.

    posted in Pythonista read more
  • JonB

    If you place the 10000 folders underneath a folder called .DB or something, I wonder if that still causes slowness. I'm thinking I have git repos with hundreds of commits resulting in thousands of files stored in . git, and don't necessarily have massive slowdown in creating or moving files, but I'm not sure.

    Could maybe have heirarchys to keep single folders small -- for instance git deals with tons of commits/blobs/trees, each which is its own folder based on the hash. But top level folders are first 2 letters of the hash, thus making it fast to lookup a particular hash -- top folder has < 256 subfolders, etc.

    posted in Pythonista read more
  • JonB

    Could you keep files on disk, and just store file name? That would keep your DB to small text, and images themselves probably change rarely

    posted in Pythonista read more
  • JonB

    https://developer.apple.com/library/archive/qa/qa1719/_index.html

    If you don't want to backup certain files, it appears you can call an obi function to exclude a file from backup. I haven't tried it.

    posted in Pythonista read more
  • JonB

    Re slowness, you might be able to place those many files in folders prefixed by period, in which case I think pythonista doesn't display them (not sure if it still has to crawl them though). You can still get to them programatically, etc.

    If you don't want to back up those files, but do want to backup everything else... I wonder if you can stick files in the non-appgroup folder. I don't know whether you can set iCloud to backup one but not the other.

    posted in Pythonista read more
  • JonB

    I think most of those methods require transferring the whole file (I don't think you can get a file handle to a Dropbox file for example).

    You could do something like Google cloud datastore, which is probably free if you are not writing to it too often. Then keep track of DB operations, and play those back to the cloud version at backup time.

    posted in Pythonista read more
  • JonB

    Looks like it is file based, and and doesn't do file diff's, at least not for binary files.

    I don't do much with sqlite, but is there a way to have it limit the size of any one file, thus splitting a DB over multiple files?

    posted in Pythonista read more
  • JonB

    Curious if anyone has tried this inside pythonista:
    https://hacks.mozilla.org/2019/04/pyodide-bringing-the-scientific-python-stack-to-the-browser/

    Looks like this could be a way to bring (slow?) scipy/pandas support into pythonista. It could also be used to integrate other c based modules. Pyiodide is a port of cypython to the JavaScript, using webassembly or asm.js. This raises interesting possibilities-- though I've seen conflicting info as to whether mobile safari would support this or not.

    posted in Pythonista read more
  • JonB

    so, i did t look much at pymunk, but i gather it is a physics library?

    check out @Cethric 's https://github.com/Cethric/OpenGLES-Pythonista

    which, along with some nice opengl wrappers, which includes a wrapper to the cannon.js library, which itself is a port of bullet physics lib to js. cethric runs cannon inside a hidden webview.

    posted in Pythonista read more
  • JonB

    @lpl Ok, fair enough. Let's close the topic until someone completely refactors lxml, then you can ask again, k?

    posted in Pythonista read more
  • JonB

    https://github.com/dgelessus/pythonista-c-utils is a cffi parser for pythonista that mocks the cffi interface (or perhaps patches a downloaded cffi to use his parser, I'm not sure)

    The c bits of ffi itself are already included in pythonista (libffi is linked in, which is how ctypes works). cffi, as I understand it, is mainly an easy way to generate the ctypes wrappers, using just c headers directly. See https://forum.omz-software.com/topic/2014/beta-tinkering-with-pythonista-s-internals-using-objc_util/8 -- cffi itself is pure and can be pip installed, but you have to set the backend to ctypes. Iirc dgelessus made a modified c parse that works specifically with core foundation headers.

    Pymunk is a wrapper around the chipmunk library, which is not included in iOS or pythonista, to my knowledge, so there is no dll for ffi to hook into. So pymunk won't work.

    posted in Pythonista read more
  • JonB

    No one is questioning that lxml is superior. But Apple's app store forbids it. Email apple with your complaint.

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!