If you are making it bad, make it REALLY bad. Angsty poems n' stuff

Don't get me wrong, I LOVE Python. I just feel Python doesn't love me...not for the last few weeks anyway.

But since I am not willing to keep on missing another homework I decided I was going to tackle this task FULL FORCE. I cannot do beautiful code, or beautiful compositions. So I'm going to do decent code and really bad, terrible compositions. 

My main inspiration for this task: Mr Ricardo Arjona


This is a very latin american reference...but he is, say not the best song writer in Spanish language. He is famous for writing with antonyms, synonyms and angsty sentences, and then sing his compositions with a sad tone in an attempt of making his songs sound deep and meaningful. So I did exactly that. All the code I use can be found in my repository.

But since these are english compositions I guess the output is more of a Cher Horowitz lyrical writting

As I have pointed out before python and myself haven't been in the best terms latetly so if it wasn't for the example in the class notes I could've never made which is my main code. Like the example code where it comes from it joins together randomly chosen words from a list of antonyms and synonyms to "quit", synonyms to "understand"  and a list of some angsty teen sentences. In there is a function that capitalizes the first letter of the selection, and another function to join them all together.

This is my favorite of all the profound teen poems I got:

Winter is killing me, tropical weather deserves a song

The countries with the best weather in the world share a lot of things, like people with good mood, paradise worth calling spaces, but above all...cacao and coffee gets produced in their land. Specially due to coffee production these countries have come to be known as The Bean Belt countries. Among them, my beloved Mexico

Image by Candy Niemeyer

Image by Candy Niemeyer

All of these countries share also the characteristic of having within their territory some sort of Tropical Weather, or being "Tropical Countries".

I miss the tropics so much these wintery days that I decided to try and compose a song for them. All of the files I used for this can be found in my repository.

My three inputs were the lyrics to a beautiful Brazilian song "Pais Tropical", the list of countries that comprise "The Bean Belt" and an explanation of the Tropical Biome

background by

background by

The most laborious part to complete the process was to remove the numbers from the country list. Since I wanted to do everything just through python programs I had to make and test several times. Once I had that done I ran which worked on the biome and the belt text and then which ran with the new text from wordchange and the Pais Tropical lyrics to get my final songLyrics.txt. All these programs were made under the guidance of the class notes so what they do is they take parts of the text and randomly re-arrange them into new texts. This is why there are periods on my final song: because getting rid of all the periods in the country list was way to hard, so I ended up leaving them and I think they work quite well to pretend a rythm within this composition.

background by

background by

A ladder to the sky

Since the introduction to python included thinking about how arithmetic operations work I was immediatly reminded of the author of my favorite book Lewis Caroll who had a special like on creating math and word games. 

Upon looking for word games I could apply for my assigment I ran into Caroll's word ladders and since I was following the class notes to guide me in the assigment I realized I could make my text look like an actual ladder.

All this ladder thinking  made my mind land on "La Bamba" which is not an origianl song by Richie Valens, or the name of your neighborhood´s hard-shell "taco" joint. "La Bamba" is a traditional "Son Jarocho" a mexican music genre from Veracruz.

(Here are over a jaroch@s breaking a world record while dancing said song)

But I'm getting off track here. 

The reason I landed in La Bamba was because part of its lyrics go: "Para llegar al cielo se necesita, se necesita una escalera larga, una escalera larga ay arriba y arriba" ("To get to the sky a long ladder is needed, a long ladder and up an up"). And since I was planning of going up there I thought that the first person I would visit in the sky it would be my grandfather.

So I decided to develop a program that would build said impossible ladder through Carrolls technique of transforming one word into another, and since land has one too many letters and is way too overated as a place to dwell, I decided to start my climb up from the sea.

Because this ladder would be ultimately connecting my grandfather and me. I picked one of his favorite authors and one of her best poems: Emily Dickinson´s "The brain is wider than the sky" and one of my favorite poets and an adequate (and incredibly beautiful) poem of his: Pablo Neruda´s "The Sea"  

So I used four very basic programs written in python: - which prints all the lines that have less than 10 characters - which prints the first ten letters of a sentence (perfect for form giving to the text) - I did various iterations of this one in order to build Caroll's ladder process of exchanging the letters in sea and sky .

And two main .txt files for each of the poems. I tried to write a complex python program to try my talets but it turns out my talents are not quite up there yet. So I designed a process that went like this:

1. $ python < sky.txt > skydos.txt :

for line in sys.stdin:
    line = line.strip()
    print line.replace ('k', 'e')

2. $ python<skydos.txt>skytres.txt:

for line in sys.stdin:
    line = line.strip()
    print line.replace ('y', 'a')

3. $ python < sea.txt > seados.txt :

for line in sys.stdin:
    line = line.strip()
    print line.replace ('e', 'k')

4. $ python < seados.txt> seatres.txt:

for line in sys.stdin:
    line = line.strip()
    print line.replace ('a', 'y')

5. $ python < skytres.txt > skycuatro.txt:

for line in sys.stdin:
  line = line.strip()
  if len(line) >= 10:
      print line

6. $ python <seatres.txt > seacuatro.txt

7. I tried to use a .py cat imitator but it didn´t work to print both archives together. So just for this process I used unix´s cat

$ python< skycuatro.txt seacuatro.txt > escalera.txt:

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

$ cat skycuatro.txt seacuatro.txt>escalera.txt

8. $ python < escalera.txt > escaleraalcielo.txt

for line in sys.stdin:
    line = line.strip()
    first_five = line[:5]
    last_five = line[-5:]
    print first_five + last_five


the be sea
for - side
the ontain
with eside
the be sea
for   blue
the obsorb
as spts do
the bf god
for  pound
and tea do
as sasound
i nkks mk,
i donnkss,
if  iknck,
or onining
thk flkkp,
in sovk in
thk uyvks.
it?s nchkd
ys iflynkt
wkrk kyth;
no, imknt,
thk ssylt,
ynd tnful.
whyt synd.
it sk myn,
to hyfirk;
thk ccold,
thk gstyr,
thk s wyvk
thk q surk
ys y pths,
ynd mntly:
ys i mknt.