Operation Manual

names = []
while True:
read_buffer += s.recv(1024)
lines = read_buffer.split(\r\n)
read_buffer = lines.pop();
for line in lines:
response = line.rstrip().split( , 3)
response_code = response[1]
if response_code == RPL_NAMREPLY:
names_list = response[3].split(:)[1]
names += names_list.split( )
if response_code == RPL_ENDOFNAMES:
print \r\nUsers in %(channel)s: % irc
for name in names:
print name
names = []
time.sleep(irc[namesinterval])
s.send(NAMES %(channel)s\r\n % irc)
GPIO Input and Output (Chapter 12)
#!/usr/bin/env python
# Raspberry Pi GPIO Input/Output example
# Written by Gareth Halfacree for the Raspberry Pi User Guide
import RPi.GPIO as GPIO
GPIO.setup(11, GPIO.OUT)
GPIO.setup(12, GPIO.IN)
GPIO.output(11, False)
while True:
input_value = GPIO.input(12)
if input_value == False:
print The button has been pressed. Lighting LED.
GPIO.output(11, True)
while input_value == False:
input_value = GPIO.input(12)
print The button has been released. Extinguishing LED.
if input_value == True:
GPIO.output(11, False)