omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. achorrath233

    Welcome!

    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.


    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 7
    • Best 0
    • Controversial 0
    • Groups 0

    achorrath233

    @achorrath233

    0
    Reputation
    735
    Profile views
    7
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    achorrath233 Unfollow Follow

    Latest posts made by achorrath233

    • RE: Using Camera within the scene?

      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
      achorrath233
      achorrath233
    • 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.

      posted in Pythonista
      achorrath233
      achorrath233
    • 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.

      posted in Pythonista
      achorrath233
      achorrath233
    • sys.stdout.writelines()

      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
      achorrath233
      achorrath233
    • 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.

      posted in Pythonista
      achorrath233
      achorrath233
    • 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?

      posted in Pythonista
      achorrath233
      achorrath233
    • 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:

      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
      achorrath233
      achorrath233