Skip to content

Instantly share code, notes, and snippets.

Allison Parrish aparrish

Block or report user

Report or block aparrish

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
aparrish / exercise.txt
Last active Aug 29, 2015
supplemental exercise for RWET
View exercise.txt
(1) create a program that prints every other line of input.
i.e., if you ran the program like so:
$ python <sea_rose.txt
it would produce the output
Rose, harsh rose,
meagre flower, thin,
aparrish /
Created Mar 27, 2014
prints out two cats
# vim:fileencoding=utf8
print u"🐱"
print u"\U0001F431"
aparrish / lebron_james.csv
Created May 29, 2014
LeBron James' 2013-2014 regular season game log, in CSV format.
View lebron_james.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 30 columns, instead of 29. in line 9.
1,1,2013-10-29,28-303,MIA,,CHI,W (+12),1,38:01,5,11,.455,0,1,.000,7,9,.778,0,6,6,8,1,0,2,0,17,16.9,+8
2,2,2013-10-30,28-304,MIA,@,PHI,L (-4),1,36:38,9,17,.529,4,7,.571,3,4,.750,0,4,4,13,0,0,4,3,25,21.4,-8
3,3,2013-11-01,28-306,MIA,@,BRK,L (-1),1,42:14,11,19,.579,1,2,.500,3,5,.600,1,6,7,6,2,1,5,2,26,19.9,-3
4,4,2013-11-03,28-308,MIA,,WAS,W (+10),1,34:41,9,14,.643,3,5,.600,4,5,.800,0,3,3,5,1,0,6,2,25,17.0,+16
5,5,2013-11-05,28-310,MIA,@,TOR,W (+9),1,36:01,13,20,.650,1,3,.333,8,8,1.000,2,6,8,8,0,1,1,2,35,33.9,+3
6,6,2013-11-07,28-312,MIA,,LAC,W (+5),1,37:09,6,13,.462,1,3,.333,5,9,.556,0,5,5,6,1,0,4,4,18,10.8,-1
7,7,2013-11-09,28-314,MIA,,BOS,L (-1),1,36:32,9,13,.692,0,0,,7,9,.778,1,7,8,10,0,0,5,1,25,23.1,+5
8,8,2013-11-12,28-317,MIA,,MIL,W (+23),1,29:58,13,21,.619,4,7,.571,3,6,.500,0,3,3,2,0,0,3,0,33,21.6,+14
9,9,2013-11-15,28-320,MIA,,DAL,W (+6),1,36:58,14,18,.778,1,1,1.000,10,11,.909,0,6,6,4,1,0,6,0,39,31.
aparrish / scores.txt
Created May 29, 2014
bunch of numbers, woo
View scores.txt
aparrish / botdraft.txt
Created Jun 7, 2014
I am not going to finish this bot today. but here's the gist! haha literally gist.
View botdraft.txt
X is a cleric. Its university is Y (
X is a ship. Its ship draft (μ) is Y (
X is a legislature. Its region served is Y (
X is a dog. Its foal date is Y (
X is a lake. Its area total (m2) is Y (
X is a automobile engine. Its piston stroke (μ) is Y (
X is a Painting. Its original title is Y (
X is a speedway league. Its location city is Y (
X is a governmental administrative region. Its iso code of a province is Y (
X is a murderer. Its waist size (μ) is Y (
aparrish /
Created Mar 11, 2015
Programming exercise D for RWET
# Worksheet #4
# This worksheet is also a Python program. Your task is to read the
# task descriptions below and then write one or more Python statements to
# carry out the tasks. There's a Python "print" statement before each
# task that will display the expected output for that task; you can use
# this to ensure that your statements are correct.
# In this worksheet, some of the tasks will throw an error that causes

Python ITP Group Regular Expressions Tutorial

I'll be working from these notes:

Source texts we'll use (download these to your working directory):

aparrish / wasteland.txt
Created May 1, 2015
gifs and t.s. eliot yay
View wasteland.txt
April is the cruellest month, breeding
Lilacs out of the dead land, mixing
Memory and desire, stirring
Dull roots with spring rain.
Winter kept us warm, covering
Earth in forgetful snow, feeding
A little life with dried tubers.
Summer surprised us, coming over the Starnbergersee
With a shower of rain; we stopped in the colonnade,
aparrish /
Created Apr 3, 2011
simple twitter search api client
import json
import urllib
import time
def search_twitter(query, callback, maxpages=10):
resp = urllib.urlopen('' % query)
data = json.loads(
for item in data['results']:
if 'next_page' in data and maxpages > 1:
aparrish /
Created Apr 3, 2011
generate simple poem from twitter search results
from twitter_search import search_twitter
import random
import sys
import re
class Thingy(object):
def __init__(self, words):
self.words = words
self.begins = dict([(word, []) for word in words])
self.ends = dict([(word, []) for word in words])
You can’t perform that action at this time.