• achorrath233

    I tried breaking out of a scene by raising an exception, but I was unable to catch it. Instead of being handled by the try/except clause I put around run(), it took me back to the interpreter and highlighted the line where the exception was raised.

    posted in Pythonista read more
  • achorrath233

    I've run into a bug with completing variables that start with '__'.

    If I type '__' and tap 'name', the completion will be inserted at the very start of the script.

    There is a workaround. Completing '__n' works as expected.

    posted in Pythonista read more
  • achorrath233

    I'd like to be able to add my own code templates. I imagine it extending the list of options you see when you press + to create a new file (Scene with Layers, Basic Scene, Empty) much like you can extend the Actions menu.

    posted in Pythonista read more
  • achorrath233

    I was trying out an example from the Python 2.7 documentation. It used sys.stdout.writelines(). This method failed with the following exception:

    'StdoutCatcher' object has no attribute 'writelines'
    

    What is StdoutCatcher?

    posted in Pythonista read more
  • achorrath233

    socket.gethostname() and socket.getfqdn() both return the name of the iPad, such as 'Johns-iPad'. This name is not going to be in DNS, which is why you're getting 'nodename ... not known'

    The way to turn the name into something that can be looked up is to append '.local' as omz does in his script. This allows the name to be looked up via Bonjour/mdns.

    If this isn't working for you, my first thought is to go to the Settings app and look up your IP address under the Wi-Fi section by tapping the arrow next to your current network.

    posted in Pythonista read more
  • achorrath233

    I was experimenting with various ways to make my background flash in a scene. One of the things I tried was animating my root layer alpha to 0 with autoreverse. I was surprised when the alpha of all my layers faded out and back in. Is this expected behavior?

    posted in Pythonista read more
  • achorrath233

    I'm used to using spaces in my python code, and I'm not used to having a tab key in iOS, so I spent some time struggling with "Indent doesn't match" type errors.

    Then I remembered that modern python does have some support for mixing spaces with tabs. I did some digging and found that you can set the tab width in a comment at the top of your code:

    tab-width: 2

    I now use this at the top of all my scripts and I no longer see indentation complaints when running them.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!