This is my recommended path for learning Haskell.
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
| # usage: | |
| # time python benchmark.py [simple|callback] <number of iterations> | |
| # | |
| # example: | |
| # time python benchmark.py simple 10000 | |
| import sys | |
| from os.path import expanduser | |
| from kivy.config import ConfigParser |
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 kivy.app import App | |
| from kivy.lang import Builder | |
| from kivy.uix.boxlayout import BoxLayout | |
| Builder.load_string(''' | |
| <ActionBarDummy> | |
| ActionBar: | |
| pos_hint: {'top':1} | |
| ActionView: |
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
| [INFO ] Kivy v1.8.0 | |
| [INFO ] [Logger ] Record log in /home/thopiekar/.kivy/logs/kivy_14-02-09_9.txt | |
| [INFO ] [Factory ] 157 symbols loaded | |
| [DEBUG ] [Cache ] register <kv.lang> with limit=None, timeout=Nones | |
| [TRACE ] [Builder ] load file /usr/lib/python2.7/dist-packages/kivy/data/style.kv | |
| [TRACE ] [Parser ] parsing 1191 lines | |
| [TRACE ] [Parser ] got directive <kivy 1.0> | |
| [TRACE ] [Builder ] build rule for <Label> | |
| [TRACE ] [Builder ] build rule for <-Button,-ToggleButton> | |
| [TRACE ] [Builder ] build rule for <BubbleContent> |
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
| MODULES= | |
| # resolve paths to needed programs, preferring Python 2 versions | |
| PYTHON="${PYTHON:-$(command -pv python2.7 || command -pv python3.4)}" | |
| PIP="${PIP:-$( | |
| command -pv pip2.7 || command -pv pip2 || command -pv pip3.4 || | |
| command -pv pip3 || command -pv pip)}" | |
| VENV="${VENV:-$( |
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
| # in other words, how is this: | |
| PythonService = autoclass('org.renpy.android.PythonService') | |
| activity = PythonService.mService | |
| # different or better than this: | |
| PythonService = autoclass('org.renpy.android.PythonService') | |
| activity = PythonService() |
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
| def make_glue(package, glue_h, glue_c): | |
| glue = """ | |
| #include "Python.h" | |
| static PyMethodDef nomethods[] = { {NULL, NULL}}; | |
| %s | |
| PyMODINIT_FUNC | |
| init%s(){ | |
| PyObject* module; | |
| PyObject* __path__; |
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 watchdog.observers import Observer | |
| # if it looks like an event handler... | |
| def call(obj): | |
| obj.dispatch = obj.__call__ | |
| return obj | |
| observer = Observer() | |
| observer.schedule(call(lambda x: print( |
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 kivy.uix.label import Label | |
| from kivy.app import App | |
| class Foo(App): | |
| def build(self): | |
| return Label(test="This is some text") | |
| if __name__ == '__main__': | |
| Foo().run() |
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
| [INFO ] Logger: Record log in /home/aspidites/.kivy/logs/kivy_14-06-08_0.txt | |
| [WARNING ] [Config ] Upgrading configuration in progress. | |
| [WARNING ] [Config ] Older configuration version detected (0 instead of 10) | |
| [INFO ] Kivy v1.8.1-dev | |
| [INFO ] Python: v2.7.7 (default, Jun 3 2014, 01:46:20) | |
| [GCC 4.9.0 20140521 (prerelease)] | |
| [INFO ] Factory: 169 symbols loaded | |
| [INFO ] Image: Providers: img_tex, img_dds, img_pygame, img_pil, img_gif | |
| [INFO ] Text: Provider: pygame | |
| [INFO ] Window: Provider: pygame(['window_egl_rpi'] ignored) |