Skip to content

Instantly share code, notes, and snippets.

View example1.py
import ui
def closepage(sender):
v.close()
def function_1(sender):
v['label1'].text = 'Oh! You clicked my button.'
#uncomment or comment lines below based on platform
#v = ui.MainView(frame=(0, 0, 600, 450)) # kivy
View analyze_tamil_poem.py
# -*- coding: utf-8 -*-
from collections import defaultdict
import re
class AsaiMaps():
@balachandrana
balachandrana / redirect_console_output.py
Last active Feb 9, 2019
redirect_console_output.py
View redirect_console_output.py
import ui
import sys
class TextViewFile(object):
def __init__(self, textview):
self.textview = textview
def write(self, msg):
self.textview.text += msg
View 3dtut10.py
from objc_util import *
import ui
import math
load_framework('SceneKit')
SCNView, SCNScene, SCNBox ,SCNNode, SCNMaterial, SCNCamera, SCNLookAtConstraint , SCNLight, SCNPlane= map(ObjCClass, ['SCNView', 'SCNScene', 'SCNBox' ,'SCNNode', 'SCNMaterial', 'SCNCamera', 'SCNLookAtConstraint', 'SCNLight', 'SCNPlane'])
class SCNVector3 (Structure):
_fields_ = [('x', c_float), ('y', c_float), ('z', c_float)]
View pathsLists.py
l = [[[[(265.0, -15.0), (348.0, -15.0), (405.0, 38.0), (438.0, 100.0)],
[(438.0, 100.0), (438.0, 0.0)],
[(438.0, 0.0), (488.0, 0.0)],
[(488.0, 0.0), (488.0, 460.0)],
[(488.0, 460.0), (438.0, 460.0)],
[(438.0, 460.0), (438.0, 362.0)],
[(438.0, 362.0), (406.0, 422.0), (350.0, 470.0), (265.0, 470.0)],
[(265.0, 470.0), (162.0, 470.0), (59.0, 388.0), (59.0, 226.0)],
[(59.0, 226.0), (59.0, 60.0), (168.0, -15.0), (265.0, -15.0)]],
[[(265.0, 31.0), (169.0, 31.0), (109.0, 116.0), (109.0, 225.0)],
View pythonista_image_views
# coding: utf-8
import bz2
from base64 import b64decode
data = '''\
QlpoOTFBWSZTWf2rpqIAEq7fgFUQUGd/9T/kmYq/79/6YAifD0d2D50GmgESoe4AOgMGop
6Jpk00GEaPUHqNDTJtTJkZBoAElJgJpglMUBoAAA0DQAA5piYCNMCMIwAAABMIwEppqaoj
QAAABoAD1NAAAEUgQBGJlU8UAAAAAAAClJEEaTTAiIAekB6g0NGgeRH5U4F2UyKh+yh09M
vXptst8B8aGUNqGRLsocKGiNsKyWMwMJkQ4cOPKqKXKoR+CijjlhhhgZIOdSl9e1Q/5jjh
FREATWyXbHkmIyNeRwI4DOb5L1Mwh+YM0AQML5jKxDXfY1K3V9zYz5ZllqGBrMYxmNFrRm
mWUT+2E4EcpGEeD/3s/LauhdZ4hwofD4ee4ceL6sevDEciKPp0lpnNX6kP7fstGzJEpS4Z
View animate.py
# coding: utf-8
# code from https://github.com/controversial/ui2/blob/master/ui2/animate.py
# code modified for bug in https://forum.omz-software.com/topic/3504/lab-ui-animate-sliding-in-views
from copy import copy
from objc_util import *
# Constants representing easings. See http://apple.co/29FOF5i
ANIMATE_EASE_IN = 1 << 16
View editmenu_simple.py
import ui
import clipboard, editor
def select_action(self):
i=editor.get_selection()
editor.set_selection(i[0],i[1]+1)
def copy_action(sender):
i=editor.get_selection()
t=editor.get_text()
View image_carousel.py
View pythonista_simpy_car_wash_example.py
import scene
import ui
"""
Carwash example.
Covers:
- Waiting for other processes
- Resources: Resource