• zrzka

    Locating Files Using Bookmarks - ObjC runtime & iOS developer guide are your friends to look for.

    posted in Pythonista read more
  • zrzka

    Try this, worked for me (no iPad around to test it now).

    posted in Pythonista read more
  • zrzka

    Hi guys,

    you probably did realize that I did nothing in the Black Mamba project for couple of months. Quite busy with other stuff. I'm still receiving Pythonista beta versions, will try to do my best to keep it up to date (read keep it working with latest Pythonista versions), but can't promise anything. If you'd like to help, maintain it or even take over, feel free to ping me and I can add you to the repository, read the docs, ... If it will work, I can even transfer repository ownership to you.

    Zrzka

    posted in Pythonista read more
  • zrzka

    @Matteo update to 3.2 & use 3.6 as default interpreter (the error is about f strings).

    posted in Pythonista read more
  • zrzka

    Basically all modules listed here are not available outside of Pythonista. There's no repository, source code, package in PyPI, ... It has no sense, because they're Pythonista specific. If you'd like to run your script on Mac, you have to provide your own sound module with functions you do use in Pythonista.

    I was thinking about new project providing compatibility layer for Mac, because I was tired of patching, mocking, ... (Sphinx, Travis CI, ...) But then I realized that almost all build / CI / ... servers I do use are running GNU/Linux. One layer for Mac, another one for GNU/Linux, ... Decided not to do it, it's not worth it.

    You should check PyObjC If you'd like to leverage existing macOS frameworks, which gives you bidirectional bridge between Python and ObjC world. If you'd like to just play sound, it can be as simple as calling afplay /path/to/your/sound/file from the Python.

    posted in Pythonista read more
  • zrzka

    Hi @ETPH. Couple of generic advices:

    • Do not use magic constants in your code (like position_options) in multiple places, it's a nightmare when you want to change them. Move them outside of create_tile, touch_began and reuse them there. Like MARGIN_OF_ERROR.
    • Keep your functions / methods short. It's good when they can fit one screen (well, depends how the screen is big :), but you know what I mean. Not a hard rule, but it's about readability and crunching all these bugs quickly. It's easier when it's short. touch_moved is very long and overly complicated.
    • You shouldn't hardcode positions based on your device in case you want to run it on iPhone SE for example.
    • Split your task into several smaller ones. Replace one huge function with many small ones doing just one thing. Again, readability & easier way how to spot a bug.

    I didn't dive into your touch_moved method, sorry. But I did quickly hack an example of generic board & moving tiles. You can find it here.

    posted in Pythonista read more
  • zrzka

    @mikael check this https://gist.github.com/zrzka/b61c74975c777a77232035a3e171337d

    • Follow instructions above line 21 to get an client ID
    • This script can be run from the Pythonista or you can add it to share extensions and run it from Photos for example

    posted in Pythonista read more
  • zrzka

    Same here, no emails. //cc @omz

    posted in General Discussion read more
  • zrzka

    @Matteo

    Re 1 - There're many extensions doing this, but I don't know if NodeBB supports it. Search for them and try. I doubt that it will work.

    Re 2 - Little bit of scripting, but doable.

    Let's say you have a topic with URL like https://forum.omz-software.com/topic/4622/notification-module-api. Every comment starts with a line like Phuket2 posted a day ago. When you tap on a day ago, URL changes to https://forum.omz-software.com/topic/4622/notification-module-api/6. And now:

    • You can prepend /api to get JSON
    • /6 is a post number starting from 1, so, the index is 6-1=5

    JSON response contains posts, which is an array of dictionaries and every dictionary has key content. You have a content now. You can get <code>xxx</code> via regex CODE_PATTERN = re.compile('\<code.*?\>(.*?)\<\/code\>', re.MULTILINE | re.DOTALL).

    Here's code with fixed URL inside:

    UPDATE: <snip>...see gist in following post, removed code & sample just not to clutter this topic...</snip>

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!