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
| import ui | |
| from random import randint | |
| import console | |
| import clipboard | |
| # Generate some random hex colors: | |
| colors = ['#%X%X%X' % (randint(0,255), randint(0,255), randint(0,255)) for i in xrange(25)] | |
| def tapped(sender): | |
| r, g, b, a = sender.background_color | |
| hex_color = '#%X%X%X' % (int(r*255), int(g*255), int(b*255)) |
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
| # coding: utf-8 | |
| # Starting point for emailing a group of people via Dispatch... | |
| # The people in the group are identified by a unique string in the Notes field. | |
| # TODO: Support setting the group identifier with an argument when launching the script via URL scheme (LCP...) - subject, body etc. could also be passed as arguments. | |
| # Change this: | |
| group_note = 'Group1' |
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
| FooBar.pdf | |
| ================================================================================ | |
| p. 4 | highlight | yellow | |
| Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor | |
| incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis | |
| nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. | |
| Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu | |
| fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in | |
| culpa qui officia deserunt mollit anim id est laborum. |
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
| import canvas | |
| canvas.set_size(512, 512) | |
| from_point = (10, 10) | |
| cp1 = (40, 200) #control point 1 | |
| cp2 = (350, 50) #control point 2 | |
| to_point = (300, 300) | |
| # Draw the actual curve: |
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
| # coding: utf-8 | |
| # Batch-upload script for how-old.net (Pythonista) | |
| import photos | |
| import requests | |
| import json | |
| import ui | |
| from io import BytesIO | |
| result_size = 320 |
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
| # coding: utf-8 | |
| # Optimized version of the code in this forum post: https://forum.omz-software.com/topic/2850/2-problems-with-shape-nodes-and-sprite-nodes | |
| from scene import * | |
| import random | |
| import ui | |
| import math | |
| def render_bottom_texture(width=100.0): |
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
| import scene, ui | |
| shadercode_text = ''' | |
| // Modified Mandelbrot code from shadertoy.com | |
| // https://www.shadertoy.com/view/XdtSRN | |
| // used make_color function from ccc (pythonista forum) | |
| // https://github.com/cclauss/fractal_hacks/blob/master/cc_mandelbrot.py | |
| precision highp float; | |
| varying vec2 v_tex_coord; |
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 proof-of-concept script for tagging photos with location data on iOS. | |
| * First, it shows all photos that have no location data *and* are editable. | |
| * Then, a grid of photos in temporal proximity is shown. You can pick multiple photos here. | |
| * When you tap Done, the photo you selected first will get tagged with the average location of the photos you picked in the second step. | |
| ''' | |
| import photos |
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
| # coding: utf-8 | |
| ''' | |
| Basic theme editor for Pythonista 1.6 (beta) | |
| WARNING: Use at your own risk! User themes aren't "officially" supported, and | |
| this may break in future versions. If you enter invalid JSON or anything else | |
| that the app can't deal with, it *will* crash -- your input is not validated | |
| in any way. | |
| ''' |
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 | |
| # 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. |
OlderNewer