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.
Script: remote-controllable digital image frame
-
Hi all,
I needed a way to make my iPad display images scaled to fullscreen without taking my hands off the keyboard/mouse of my main computer. Thus ImageFrame.py was born:
http://tinyurl.com/iosimageframe
Just run this script in Pythonista and it will start up with a fullscreen display of the 'test:Lenna' image included in Pythonista. Then use the provided script send-image.py on your main computer to upload an image and have it displayed instead (requires the requests library). The image is added to the Photo Library on your iOS device in an album called "Image Frame" (which will be created if it does not exist yet). I add this script as a handler for images to the right-click context menu of my file browser. You can also point your browser to http://<ip of your ios device>:8080/ and upload an image via an HTML form. Use a 2-finger wipe down to end the script.
I use this for displaying reference images while drawing or cheat sheets for keyboard shortcuts or programming languages while coding. But it also makes it possible to use your iPad as an over-priced digital image frame ;)
Bugs / Areas for possible future improvements:
- Runs on Pythonista 2 or 3, although on Pythonista 3 there are some problems with uploading images through the browser. The send-image.py script simply sends the image via HTTP PUT and this works without problems on both Pythonista 2 and 3.
- No authentication whatsoever
- You need to pass the IP address of your iOS device to the upload script or edit it to set the default.
- The network status, clock and battery status are always displayed at the top of the screen.
- Some sort of automatic slideshow display would be nice.
Share & Enjoy, Chris
-
Cool tool!
When I
print(version)
after line 22 ofImageFrame.py
, I get (0, 12) instead of (0, 12, 7). To get the right value, you could change line 22 to read:version = tuple(int(s) for s in bottle.__version__.split('.'))
and then delete lines 21 and 3. -
Thanks for the heads up!
There was an error in the regex to parse the bottle version. Should be fixed now. Your approach unfortunately wouldn't work with version strings like '0.13-dev'. Anyway, I think on Python 2 the version of bottle included with Pythonista should be fine, so I adapted the code to reflect this too.