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
# http://omz-forums.appspot.com/pythonista/post/5144563366756352 | |
import random, scene | |
sizeInPixels = 100 | |
def rectFromPt(inPoint): # returns a scene.Rect centered on inPoint | |
half = sizeInPixels / 2 | |
return scene.Rect(inPoint.x - half, inPoint.y - half, sizeInPixels, sizeInPixels) | |
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
from scene import * | |
from random import random | |
class MyScene (Scene): | |
def setup(self): | |
# This will be called before the first frame is drawn. | |
self.root_layer = Layer(self.bounds) | |
self.mLines = [] | |
self.mCount = 0 | |
(self.mCurrLocX, self.mCurrLocY) = self.bounds.center() |
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
#!/usr/bin/env python | |
# installNyamuk -- https://github.com/iwanbk/nyamuk | |
# download from github the nyamuk Python library and install it for Pythonista on iOS | |
#import nyamuk, sys # uncomment if you want to test if nyamuk is already installed | |
#print('got it...') | |
#sys.exit() | |
import os, shutil, urllib, zipfile |
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
# Play a blues melody on Pythonista on the iPad (iOS) | |
import sound | |
import time | |
def playNotes(inNotes, inWithEmphisis=False): | |
for note in inNotes: | |
sound.play_effect('Piano_' + note) | |
if (inWithEmphisis): | |
time.sleep(0.25) | |
sound.play_effect('Piano_' + note) |
NewerOlder