Sleepy Weim

Python: Picture Tiles that Change

If you jumped straight here, I get it. This code is for randomly selecting a photo from a directory, and saving it to a predefined location and filename. Very sexy, of course, so you couldn’t wait to get here and start running with it! Feel free to play with the code, break things, and then go back and read the main page where I explain why I do certain things. 😉 There are four main

Python: Countdown Image

In this example of my script I have a Disney and a Christmas countdown to show you the differences between a customized and a plain countdown. Even my plain countdown has a font specified. As with my previous code, you need to have Pillow installed. For the custom fonts, I added a ‘fonts’ folder in my script folder, and added the files there. On my Mac, I can open ‘Font Book’, look at my fonts,

Python: Fetch Weather for ActionTiles

So, this is pulling together the other two scripts I wrote (download and crop images). Really, this is just for you to see the iterations of what I did before I got here. I could have just jumped you straight to here, but it helps to see the individual components before getting more complicated in a single script. The standard walk before you run. This script takes the download script, the crop script, and then

Python: Crop Image

While getting the images is important on it’s own, I ran into the issue of sizing with ActionTiles. The tiles I’m using to display pictures are 2×3, so they are basically a perfect size for a landscape oriented image. And even though I have a tablet that is larger than most, the size of each tile is not huge. Looking at the weather images, there was a whole lot of border that I really didn’t

Python: Fetch Image

Grabbing an image from a URL is fairly simple. In this script I create two string objects, define them with the URL, and then use the Retrieve method to save them into the folder.

ActionTiles: Show Local Weather

After I had played with some of the basics of getting tiles in place to control my smart lighting (Philips Hue), I wanted to get some more dynamic content. I wanted pictures and changing tiles and cool looking things to impress, but also to be useful. Reading through the forums, I found that people had copied links from their local news stations for weather imagery.