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
import piface.pfio as pfio | |
from wiimote import WiimoteConnect | |
class WiiBot(WiimoteConnect): | |
""" | |
Use Wiimote to control robot | |
Basic usage: | |
from wiibot import WiiBot |
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
import time | |
import cwiid | |
import threading | |
class WiimoteBase(object): | |
""" | |
Base class for sending Wiimote button presses to class | |
methods. Subclass to implement actions in the methods. |
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
import time | |
import cwiid | |
class Wiible(): | |
buttons = [ | |
"BTN_2", | |
"BTN_1", | |
"BTN_B", |
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 django.conf import settings | |
from django.db.models.deletion import Collector | |
from django.db.utils import ConnectionRouter | |
def deletable_objects(obj): | |
""" | |
Return a generator that yields (model, instance) tuples | |
of instances related to obj (including obj itself). | |
Essentially, programmatic access to the data Django Admin |
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 cProfile import Profile | |
import pstats | |
def profile(sort_args=['cumulative'], print_args=[10]): | |
profiler = Profile() | |
def decorator(fn): | |
def inner(*args, **kwargs): | |
result = None |
NewerOlder