Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View matham's full-sized avatar

Matt Einhorn matham

View GitHub Profile
@matham
matham / scatter_matrix.py
Created October 24, 2018 05:47
Shows how to use a kivy matrix to acomplish the same that scatter does (ignoring the touch transfomration).
from kivy.uix.scatter import Scatter
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
from kivy.app import runTouchApp
kv = """
#:import Matrix kivy.graphics.transformation.Matrix
BoxLayout:
Scatter:
id: scatter
@matham
matham / kivy_gui.png
Last active August 24, 2018 23:41
gui
from kivy.lang import Builder
from kivy.app import runTouchApp
runTouchApp(Builder.load_string('''
#:import Factory kivy.factory.Factory
BoxLayout:
orientation: 'vertical'
padding: "12dp"
spacing: "12dp"
class FileChooserProgress(FileChooserProgressBase):
@KV()
def apply_kv(self):
with KVCtx():
self.pos_hint = {'x': 0, 'y': 0}
with self.canvas:
Factory.Color(rgba=(0, 0, 0, .8))
rect = Factory.Rectangle()
rect.pos ^= self.pos
class FileChooserProgress(FileChooserProgressBase):
@KV()
def apply_kv(self):
with KVCtx():
self.pos_hint = {'x': 0, 'y': 0}
with self.canvas:
Factory.Color(rgba=(0, 0, 0, .8))
rect = Factory.Rectangle()
rect.pos ^= self.pos
'''
FileChooser
===========
The FileChooser module provides various classes for describing, displaying and
browsing file systems.
Simple widgets
--------------

Due to recent abusive intrusions into our channel, we may need to temporarily restrict participation to users who have registered accounts on Freenode. If you have received a Cannot send to channel message when attempting to talk, you can validate that you are not a malicious user and regain the ability to send messages to the channel by registering your account. Please see the link below for instructions, and don't hesitate to stop by #freenode to ask for help.

https://freenode.net/faq.shtml#nicksetup

from timeit import timeit
from random import randint
class Base(object):
pass
class Derived1(Base):
pass
'''
Graph
======
The :class:`Graph` widget is a widget for displaying plots. It supports
drawing multiple plot with different colors on the Graph. It also supports
axes titles, ticks, labeled ticks, grids and a log or linear representation on
both the x and y axis, independently.
To display a plot. First create a graph which will function as a "canvas" for
python_version download_count
3.6 17276
2.7 13728
null 12301
3.5 5049
3.4 2202
3.2 306
3.7 240
1.17 55
3.3 34
class TrioPortal:
def __init__(self, trio_token=None):
if trio_token is None:
trio_token = _core.current_trio_token()
self._trio_token = trio_token
# This is the part that runs in the trio thread
def _run_cb_async(self, afn, args, task, token):
@_core.disable_ki_protection