The Center for Sustainable Foolishness

"Start a huge, foolish project, like Noah. It makes absolutely no difference what people think of you." -Rumi

Python Final – A Textual Feminist Orgy

I wanted to play with feminist texts, and how women express themselves.

I.
Source Text: Maya Angelou’s 1993 Inaugural Poem

Hosts to species long since departed,
Of their sojourn here
Plant yourself beside me, here beside the river.
Each of you, descendant of some passed on

the mastodon
the gloom
the Rock
the wall
the world
the songs
the tree
the wise
the Asian
the Hispanic
the Jew
the Sioux
the Muslim
the French
the Greek
the Rabbi
the Priest
the Sheikh
the Straight
the Preacher
the homeless
the teacher
the tree
the first
the river
the river
the employment
the Turk
the Swede
the German
the Scot
the Ashanti
the Yoruba
the Kru
the tree
the river
the rock
the river
the tree
the dream
the palms
the shape
the pulse
the courage
the river
the tree
the mendicant
the mastodon
the pulse
the grace

In hope.py, I spell out the word “HOPE” with Angelou’s poem

import urllib
import sys
import re

printed = [r'^[Hh]', r'^[Oo]', r'^[Pp]', r'^[Ee]']

for exp in printed:
for line in sys.stdin:
line = line.strip()
if re.search(exp, line):
print line
break

and then I use a second program, maya.py, to pull out where exactly we can find hope in Angelou’s text.

import urllib
import sys
import re

for line in sys.stdin:
line = line.strip()
for matching_string in re.findall(r' \b[Tt]he \w+',  line):
print matching_string

 

II.
Source Text: Dorothy Allison’s Interview for the Smith College Voices of Feminism Oral History Project

They get so nervous about touching lesbians.
panicking, because I was a lesbian and it was — oh my God, it was
and panicking because of the lesbian issue.
They were not comfortable with lesbians, and so I could have lost my
scholarship just to have been revealed as a lesbian, especially since I
with a woman I fell in love with who died, and bad things happened.
junkies were not a good idea to fall in love with.
Yeah, yeah. I loved her a lot. She was profoundly self-destructive, and
looking for it. And my hidden agenda was to find the other lesbians,
It was more about the lesbian piece, is what I’m hearing, instead of –
Oh yes. Early lesbian magazines; so The Furies. There was a good
called? The first lesbian magazine was the one those girls were doing
The consciousness-raising group — two things. I fell in love
flannel shirt, who was the classic 70s lesbian. She even had the duckbill
as strictly 70s flannel lesbian, without any secretaries.
completely uninteresting to me. Flannel lesbians were not where my
boy, I loved militant non-monogamy.
lesbian feminist collective which we founded.
for women’s-movement lesbians. You know, You girls. And it was
– a lot of women’s-movement lesbians presented androgynously —
movement lesbians of being prejudiced against genuine, real lesbians,
we went up to Sagaris [Institute], and by that time, our lesbian collective
lesbian feminists, and we were all separatists — our distance from the
when lesbians and queers were — you were crazy. And it was still that
identify as a lesbian, you become a pervert.
then, when there was so much fear around lesbianism?
trying to respect women’s rights. They’re uncomfortable with lesbians,

 

Here, in dyke.py, I search for and pull out the lines that mention “lesbian” and “love.”

import sys

searchstr = "lesbian"

for line in sys.stdin:
line = line.strip()
if searchstr in line:
print line

offset = line.find("love")
if offset != -1:
print line

 

III.
Source Text: Audre Lorde’s speech at the 1977 Lesbian and Literature Panel in Chicago

I am the because I am Black
I am the because I am lesbian
I am the because I am myself
I am a because I am Black
I am a because I am lesbian
I am a because I am myself
I am Black because I am Black
I am Black because I am lesbian
I am Black because I am myself
I am lesbian because I am Black
I am lesbian because I am lesbian
I am lesbian because I am myself
I am myself because I am Black
I am myself because I am lesbian
I am myself because I am myself
I am afraid because the transformation of
I told her because the transformation of

 

iamlorde.py

import sys
import re

everything = list()

for line in sys.stdin:
line = line.strip()
for audre in re.findall(r'\b[Ii] \w+ \w+', line):
for lorde in re.findall(r'\bbecause \w+ \w+ \w+', line):
poem = audre + " " + lorde
everything.append(poem)

for line in everything:
print line

 

Switching things around a little bit, here is Maya on Dorothy

home in Guerneville, on November 18th, and we’re doing an oral
One of the things that I like best that you said — and again, that’s kind
panicking, because I was a lesbian and it was — oh my God, it was
employed person.

 

and Maya on Lorde

the risk
the speaking
the transformation
the time
the other
the final
the words
the tyrannies
the face
the transformation
the mouth
the inside
the cause
the face
the visibility
the source
the machine
the power
the reclaiming
the transformation
the truth
the truth
the harsh
the time
the same
the weight

 

and Lorde on Allison

I was a because I was a
I got hysterical because I got hysterical
I tried to because I tried to
I had been because I had been
I did not because I did not
I had been because I did not
I had a because I had a
I was fascinated because I was fascinated

Add a comment

Python Midterm

My program attempts to find the lines in a text that begin and end with a vowel, and print them. What I couldn’t figure out was how to find lines that end with just a vowel OR end with a vowel AND a period.

import sys
import re

for line in sys.stdin:
  line = line.strip()
  if re.search(r'^[AaEeIiOoUu].+[aeiou]$', line):
    print line

Dr. Seuss’ “The Daddy Poem”
resulted in:
If my daddy had shacked up with somebody else
I wouldn’t have resulted, I wouldn’t be me

i carry your heart with me by E. E. Cummings

resulted in:
i go you go,my dear; and whatever is done
and whatever a sun will always sing is you

and Mark Twain’s Anti Imperialist Essays

resulted in:
eagle to go screaming into the Pacific. It seemed tiresome and tame for it to
I asked myself? And I thought it would be a real good thing to do
I said to myself, here are a people who have suffered for three centuries. We
own, put a miniature of the American constitution afloat in the Pacific, start a
of Paris, and I have seen that we do not intend to free, but to subjugate the
Oh, you have been doing many things in this time that I have been absent; you
it to sell; we have robbed a trusting friend of his land and his liberty; we
And as for a flag for the Philippine Province, it is easily managed. We can have
a special one–our States do it: we can have just our usual flag, with the white
unclean contacts, lest it suffer pollution; and so when it was sent out to the

Add a comment

Queer Vlogs

Sarah Jenny and I covered queer events at the end of February for our vlog assignment.

Mauricio Medina interviews painter Grace Moon, whose paintings were exhibited at the Leslie/Lohman gallery. The exhibit was called, “When Girls Were Boys and Boys Were Girls.”

We also cover the very last Pantyho’s ever! After 4 years of a spectacular all gender queer dance performance/music/dance party, Sarah Jenny and Krystal interview and record some of the event’s final moments in this commemorative vlog.

If the embed below does not work… here is the link.

Add a comment

Bukowski and Neruda, Python HW #2

I am attempting to modify the alpha_replace program, trying to take all the 4 letter words out of the Charles Bukowski poem, “Somebody,” and replace them with a random four letter word from Pablo Neruda’s poem, “Ode to a Naked Beauty.” I’m looking at playing with the way these writers view women, and messing around with the vulgarity of Bukowski’s work.

My code is taken from other folk’s examples, but when I try to run it, it this comes up in the terminal window:

File “cuss_out.py”, line 14
lengthWord = len(word)
^
IndentationError: expected an indented block

I’m not quite sure what that is…. My code so far is below.

import sys
import random

source_alpha = dict()
source_file = sys.argv[1] # first argument passed on command line

# read each line from source file; split each line into words; store each
# word in the source_alpha dictionary, according to which letter it starts with
for line in open(source_file):
       line = line.strip()
       words = line.split(" ")
       for word in words:
               if len(word) > 3: # check to make sure we have a word
               lengthWord = len(word)

               # if we've already seen this letter, append to list
               if lengthWord in source_alpha:
                       source_alpha[lengthWord].append(word)
               else:
                       source_alpha[lengthWord] = [word]

# source_alpha will be a dictionary whose keys are strings and whose values
# are lists.
# uncomment this to see what the data structure created above looks like
#print source_alpha

# read each line from standard input; split line into words; for each word,
# get a random word beginning with the same letter from source_alpha
for line in sys.stdin:
       line = line.strip()
       words = line.split(" ")
       output = ""
       for word in words:
               if len(word) > 0:
                       lengthWord = len[word]
                       if lengthWord in source_alpha:
                               if lengthWord > 3:
                                       source_words = source_alpha[lengthWord]
                                       output += random.choice(source_words)
                               else:
                                       output += word
                               output += " "
       print output

Add a comment

Pulse

Documentary for Video for New Media. Krystal Banzon, Allison Walker, and Lucas Werthein.

Add a comment

Coffee and Crosswords.

First Video for New Media Project with Sarah Jenny. From Craig’s List Missed Connections.

Add a comment

First Python Excercise

I played around with T.S. Eliot’s “The Love Song of J. Alfred Prufrock.” I put the text into textwrangler, and put it in the /rwet/session02 directory. Then I used the examples in class to play around with which words and lines to take out. I decided to search for the lines that contain “dare” and “time.” I also wanted to find the lines with the word “go,” and print the lines just beginning with “go.” I had hard time figuring it out, and ended up missing the “g” – but I liked how it turned out. I was trying to figure out how to alphabetize the lines, but couldn’t figure it out.

I came up with this:

o then, you and I,
o, through certain half-deserted streets,
o and make our visit.
o
And indeed there will be time
There will be time, there will be time
There will be time to murder and create,
And time for all the works and days of hands
Time for you and time for me,
And time yet for a hundred indecisions,
o
And indeed there will be time
To wonder, “Do I dare?” and, “Do I dare?”
Do I dare
In a minute there is time
one at dusk through narrow streets
At times, indeed, almost ridiculous—
Almost, at times, the Fool.
Shall I part my hair behind? Do I dare to eat a peach?

From my little, confused program “proffy.py” (below):

# our very first program
import sys

searchstr = “dare”

for line in sys.stdin:
line = line.strip()
if searchstr in line:
print line

offset = line.find(“go”)
if offset != -1:
print line[offset+1:]

offset = line.find(“time”)
if offset != -1:
print line
#[offset+1:]

Add a comment