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.
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Latest posts made by achorrath233
RE: Using Camera within the scene?
Code completion bug
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.
RE: Feature Requests
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.
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?
RE: A Simple HTTP Server
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.
Root Layer Alpha
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?
Tip: Mixing Spaces with Tabs
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:
I now use this at the top of all my scripts and I no longer see indentation complaints when running them.