This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file should be saved as code.py | |
# At MagTag startup (or at wakeup time), keep one one of the 4 button pressed. | |
# The MagTag will switch to the program you choose and remember that decision at each wakeup. | |
# The trick is to have for each button one CircuitPython program to import. | |
# You can customise the app_to_start list, here is the current setting: | |
# no button => magtag_weather | |
# 1 (D15) => magtag_showtimes | |
# 2 (D14) => magtag_tree | |
# 3 (D12) => magtag_spacex | |
# 4 (D11) => magtag_year_progress_percent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python3 | |
''' | |
Directions: | |
- install yt-dlp via Pip (e.g. using (StaSh)[https://github.com/ywangd/stash] - `pip install yt-dlp`) | |
- add this script as a Share extension through Settings -> Share Extension Shortcuts | |
- while watching a video in the YouTube site or app, just share the video to Pythonista and select this script | |
- the video will download, and when it's done you can share the video file itself with any app (e.g. VLC) | |
Advanced usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python3 | |
''' | |
This is a demo of how you can use the CoreML framework (via objc_util) to classify images in Pythonista. It downloads the trained 'MobileNet' CoreML model from the Internet, and uses it to classify images that are either taken with the camera, or picked from the photo library. | |
''' | |
import requests | |
import os | |
import io | |
import photos | |
import dialogs |