An App for Running Small Python Scripts On iPhone:
Pythonista is an app for the iphone that allows you to run python scripts. It doesn’t have completely full python capabilities, but the modules available are still impressive. It has the full numpy and matlab lib for example. The examples that come with the app include python scripts for making quick memes using photos in your photo gallery, memory type card games, clocks, air hockey, and a quick color mixer (to find the RGB of that house color you like so much).Apple usually blocks apps that allow you to write/run code on your iphone, and for a short time Pythonista was blocked, but apparently middle ground was found.
“Flowing Particle” was my first attempt at using pythonista. My goal was make something simple and pretty to show my 2 year old nephew.I started with an example script that came with the app called “particle”. It was modified to improve the degree to which the behavior of the particles seemed realistic and the aesthetic appearance. Any touch to the screen initiates creation of “particles”. I had the particles “fall” towards the direction farthest from where most people’s thumb rests. The particles also spread out if too many are piled up on top each other. As each particles’ age increases, it changes in color. The more particles that overlap, the greater their brightness, until the color goes to white.The result is colorful, relaxing, and interesting enough to briefly overcome his mother’s rule about no screen time.Click here to Open a video of the python scrip in actionor check out the code on github: