This file contains 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
# FontInstaller (by @olemoritz) | |
# This script installs a custom TTF font on iOS (system-wide). | |
# It can be used in one of two ways: | |
# 1. Simply run it in Pythonista, you'll be prompted for the URL of the font | |
# you'd like to install (if there's a URL in the clipboard, it'll be used by default) | |
# 2. Use it as an 'Open in...' handler, i.e. select this file in Pythonista's 'Open in... | |
# menu' setting. This way, you can simply download a ttf file in Safari and open it in |
This file contains 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
# File Transfer for Pythonista | |
# ============================ | |
# This script allows you to transfer Python files from | |
# and to Pythonista via local Wifi. | |
# It starts a basic HTTP server that you can access | |
# as a web page from your browser. | |
# When you upload a file that already exists, it is | |
# renamed automatically. | |
# From Pythonista's settings, you can add this script | |
# to the actions menu of the editor for quick access. |
This file contains 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
from scene import * | |
from random import randint, random, choice | |
from sound import play_effect | |
from colorsys import hsv_to_rgb | |
from math import sin | |
from functools import partial | |
from copy import copy | |
class Star (object): | |
def __init__(self): |
This file contains 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
# coding: utf-8 | |
import ui | |
import os | |
from objc_util import ObjCInstance, ObjCClass | |
from operator import attrgetter | |
import time | |
import threading | |
import functools | |
import ftplib | |
import re |
This file contains 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
# Quick workaround for photos module (Pythonista) not downloading photos from iCloud | |
import photos | |
from objc_util import ObjCClass, ObjCInstance, ObjCBlock | |
def download_cloud_asset(asset): | |
PHImageManager = ObjCClass('PHImageManager') | |
PHImageRequestOptions = ObjCClass('PHImageRequestOptions') | |
ph_asset = ObjCInstance(asset) | |
ph_image_mgr = PHImageManager.defaultManager() |
This file contains 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
# Shows a list of the 10 top paid apps on the App Store. | |
print 'Loading...' | |
import feedparser | |
import console | |
print 'Fetching Feed...' | |
feed = feedparser.parse('http://itunes.apple.com/us/rss/toppaidapplications/limit=10/xml') | |
entries = feed['entries'] |
This file contains 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
# Simple URL shortener using is.gd | |
# | |
# Save this script as 'ShortURL' in Pythonista and add the | |
# bookmarklet below to Safari. The result is copied to the clipboard. | |
# Bookmarklet: | |
# javascript:window.location.href='pythonista://ShortURL?action=run&argv='+encodeURIComponent(window.location.href); | |
import clipboard | |
import re |
This file contains 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 | |
# Share sheet extension script for adding new pages to Swift Playgrounds (experimental) | |
# HOW TO USE: | |
# 1. Add this script as a shortcut to the Pythonista extension (either from Pythonista's settings or the share sheet extension itself) | |
# 2. Tap the "Share" button in the Playground app's library. | |
# 3. Select the playground that you want to add a page to | |
# 4. Select "Run Pythonista Script" in the share sheet | |
# 5. Run this script, to select the chapter and page title. |
This file contains 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
# coding: utf-8 | |
'''Creates a zip archive of your Pythonista files and serves them via HTTP in your local network.''' | |
import sys | |
if sys.version_info[0] >= 3: | |
from http.server import SimpleHTTPRequestHandler, HTTPServer | |
else: | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
from BaseHTTPServer import HTTPServer |
This file contains 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
# Pythonista script to show the UI Debugging overlay (private API) described in this blog post: | |
# http://ryanipete.com/blog/ios/swift/objective-c/uidebugginginformationoverlay/ | |
from objc_util import ObjCClass, on_main_thread | |
UIDebuggingInformationOverlay = ObjCClass('UIDebuggingInformationOverlay') | |
@on_main_thread | |
def toggle_overlay(): | |
UIDebuggingInformationOverlay.prepareDebuggingOverlay() | |
UIDebuggingInformationOverlay.overlay().toggleVisibility() |
NewerOlder