This file contains 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
Edit: had to remove >< from the output otherwise it wasn't displayed here. | |
It might be worth noting that I already have a Python installation. | |
I have managed to get gdb running. As for the frame # command, I couldn't see which number contained the fault so I tried a few of the ones listed at random, they just returned the same info from the bt list: | |
botstrapping Kivy @ C:\Kivy\ | |
Setting Environment Variables: | |
################################# | |
GST_REGISTRY |
This file contains 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
py.test tests/system | |
============================= test session starts ============================== | |
platform linux2 -- Python 2.7.3 -- pytest-2.2.3 | |
collecting ... collected 33 items | |
tests/system/test_clock.py .. | |
tests/system/test_time.py .......... | |
tests/system/test_vector2.py .......... | |
tests/system/test_vector3.py ........... |
This file contains 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
============================= test session starts ============================== | |
platform linux2 -- Python 2.7.3 -- pytest-2.2.3 | |
collecting ... collected 35 items / 4 errors | |
tests/network/test_http.py .E | |
tests/system/test_clock.py .. | |
tests/system/test_time.py .......... | |
tests/system/test_vector2.py .......... | |
tests/system/test_vector3.py ........... |
This file contains 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 functools import partial | |
from timeit import timeit | |
from kivy.utils import * | |
x, y = range(10), range(5, 15) | |
intersection(x, y) | |
# OUT: [5, 6, 7, 8, 9] | |
intersection2(x, y) | |
# OUT: [5, 6, 7, 8, 9] | |
difference(x, y) | |
# OUT: [0, 1, 2, 3, 4] |
This file contains 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
import sfml as sf | |
import alligator as ag | |
# yours | |
while window.is_opened: | |
# handle and filter events | |
remaining_events = interface.handle_events(window.pending_events) | |
# your event processing loop as usual | |
for event in remaining_events: |
This file contains 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
# I grepped the lib directory and was unable to actually find "MainWindow". That said, I don't think it's a good idea anyways... | |
# yours | |
window = ag.MainWindow(sf.VideoMode(640, 480), "pySFML2 - my first Aligator app") | |
# mine | |
# Only a nine character difference | |
window = ag.Ui(sf.RenderWindow(sf.VideoMode(640, 480), "pySFML2 - my first Aligator app")) | |
# If users are really creating *that* many windows, they could write a lambda to save some typing. |
This file contains 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
# I think it would be nice to convert bind from an instance method to a module function. | |
# yours | |
def print_mouse_in(): | |
print("The cursor has entered the widget's area") | |
def print_mouse_out(): | |
print("The cursor has left the widget's area") | |
myimage.bind(ag.MOUSE_IN, print_mouse_in) | |
myimage.bind(ag.MOUSE_OUT, print_mouse_out) |
This file contains 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
@bind([widget_a, widget_b], ag.MOUSE_IN) | |
def foo(): | |
pass | |
# or | |
@bind({ | |
widget_a: ag.MOUSE_IN, | |
widget_b: ag.MOUSE_OUT{) | |
def foo(): | |
pass |
This file contains 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
{- | super simple format | |
1 Elvish Druid | |
2 Elvish Swordsman | |
1 Elvish Marksman | |
While this is simple enough to parse, if we wanted to do something like | |
live decks, it we'd have to implement a custom parser, which I'd only want | |
to do as a last resort. |
This file contains 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 timeit import timeit | |
children = range(1, 1000) | |
number = 10000 | |
def indexof(x): | |
for i in range(len(children)): | |
if children[i] is x: | |
return i |