View hands.txt
High Card: 1,302,540 (50.1177%)
Pair: 1,098,240 (42.2569%)
Two Pair: 123,552 (4.7539%)
Three of a Kind: 54,912 (2.1128%)
Straight: 10,200 (0.3925%)
Flush: 5,108 (0.1965%)
Full House: 3,744 (0.1441%)
Four of a Kind: 624 (0.0240%)
Straight Flush: 36 (0.0014%)
Royal Flush: 4 (0.0002%)
View sense_hat_emu.py
from sense_hat import SenseHat
from sense_emu import SenseHat as SenseEmu
hat = SenseHat()
emu = SenseEmu()
while True:
temp = emu.temperature
r = int(min(max(0, temp), 100) / 100 * 255)
print('{:3d}'.format(r), end='\r', flush=True)
View poker.py
from itertools import product
from random import shuffle
VALUES = '23456789TJQKA'
SUITS = 'HDSC'
HAND_TYPES = (
'High Card',
'Pair',
'Two Pairs',
View tree_sp.py
# See http://bennuttall.com/raspberry-pi-zero-gpio-expander/
from gpiozero import LED, LEDBoard, SnowPi
from gpiozero.pins.pigpio import PiGPIOFactory
from gpiozero.tools import random_values
from signal import pause
pizero = PiGPIOFactory('fe80::1%usb0')
star = LED(2, initial_value=True)
View tensorflow_build.sh
# instructions scripted from https://github.com/samjabrahams/tensorflow-on-raspberry-pi/blob/master/GUIDE.md
apt update
apt -y upgrade
apt -y install pkg-config zip g++ zlib1g-dev unzip python-pip python-numpy swig python-dev python3-pip \
python3-numpy python3-dev oracle-java8-jdk
# bazel
wget https://github.com/bazelbuild/bazel/releases/download/0.9.0/bazel-0.9.0-dist.zip -O bazel.zip
unzip -d bazel bazel.zip
View 1_led.py
from gpiozero import LED
from time import sleep
led = LED(17)
while True:
led.on()
sleep(1)
led.off()
sleep(1)
View gpiozero_config_parser.py
import gpiozero
from signal import pause
import json
try:
import yaml
except ImportError:
yaml = None
classes = {
name: cls
View sense_robot_mock.py
# run with GPIOZERO_PIN_FACTORY=mock python3 sense_robot_mock.py
import gpiozero
from gpiozero import Robot
from gpiozero.pins.mock import MockPWMPin
from sense_emu import SenseHat
from time import sleep
gpiozero.Device.pin_factory.pin_class = MockPWMPin
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
View 1_rpigpio.py
import time
import RPi.GPIO as GPIO
global lampe1
global lampe2
global lampe3
global lampe4
global lampe5
global lampe6