Skip to content

Instantly share code, notes, and snippets.

View ohaz's full-sized avatar

Richard Baumann ohaz

View GitHub Profile
@ohaz
ohaz / scrollview.kv
Created March 17, 2016 06:42
An example for a scrollview in kivy
ScrollView:
do_scroll_x: False
GridLayout:
cols: 1
size_hint_y: None
height: self.minimum_height
Label:
text: 'Title'
size_hint_y: None
height: '29sp'
@ohaz
ohaz / main.py
Created March 8, 2016 09:07
Parse math formulas in python and put parentheses around Mult/Div
from __future__ import print_function
import ast
def recurse(node):
if isinstance(node, ast.BinOp):
if isinstance(node.op, ast.Mult) or isinstance(node.op, ast.Div):
print('(', end='')
recurse(node.left)
recurse(node.op)