Skip to content

Instantly share code, notes, and snippets.

@LilyFoote
LilyFoote / reusable.py
Last active March 8, 2021 22:30
A reusable generator
def reusable(generator):
"""Convert a generator into a ReusableIterator."""
class ReusableIterator:
"""Create an wrapper for a generator to allow repeated iteration."""
def __init__(self, *args, **kwargs):
"""Store the arguments to pass to the wrapped generator."""
self.args = args
self.kwargs = kwargs

Keybase proof

I hereby claim:

  • I am ian-foote on github.
  • I am quartic (https://keybase.io/quartic) on keybase.
  • I have a public key whose fingerprint is D58B C2D9 98F8 4E3E BD28 7C88 E0EC 5783 05EC F5B3

To claim this, I am signing this object:

@LilyFoote
LilyFoote / install instructions
Last active August 29, 2015 14:02
Install kivy in a virtualenv without site-packages using wheel
pip install wheel
hg clone https://bitbucket.org/pygame/pygame
cd pygame
pip wheel .
cd
git clone git@github.com:kivy/kivy.git
git checkout 1.8.0
cd kivy
#:import KivyLexer kivy.extras.highlight.KivyLexer
CodeInput:
lexer: KivyLexer()
font_size: '30pt'
text: "Label:\n\ttext: 'A label'\n\tfont_size: '60pt'\n\tcanvas:\n\t\tColor:\n\t\t\trgb: 1, 0, 0\n\t\tRectangle:\n\t\t\tpos: self.pos\n\t\t\tsize: self.size"