World’s first poem written in python
Posted by majutsu on December 23, 2007
# This poem was generated from Python 2.5 using a series of list object operations. # All output (including the output authoring it's own source code) # was sent to the textfile using a virtual compiler during runtime. Wise Remembrances I am not the things I have. I am not the people I love. I am not the labors I do. I am not the perceptions I experience. I am not the thoughts I think. I am not the emotions I feel. I am not the rules I follow. But in this moment . . . The rules I follow become me. The emotions I feel become me. The thoughts I think become me. The perceptions I experience become me. The labors I do become me. The people I love become me. The things I have become me. Rules I follow. Perceptions I experience. Thoughts I think. Labors I do. Things I have. People I love. Emotions I feel. But I will be unhappy if I forget . . . I am not the things I have. I am not the people I love. I am not the labors I do. I am not the perceptions I experience. I am not the thoughts I think. I am not the emotions I feel. I am not the rules I follow. # Like any good poet, I bare my own innards below: import random, sys fileout=open('Wise_remembrances.txt','w') myinnards=open('wiseremembrances.py','r') myinnards_exposed=myinnards.read() sys.stdout=fileout print '# This poem was generated from Python 2.5 using a series of list object operations.' print '# All output (including the output authoring it\'s own source code)' print '# was sent to the textfile using a virtual compiler during runtime.\n' print '\n\nWise Remembrances\n\n' global itemcounter objectlist=[ 'the things I have', 'the people I love', 'the labors I do', 'the perceptions I experience', 'the thoughts I think', 'the emotions I feel', 'the rules I follow'] itemcounter=0 def denunciation(objectlist,itemcounter,grade): for item in objectlist: print itemcounter*'\t'+'I am not '+item+'.\n', itemcounter+=grade return itemcounter def repunct(objectlist): for index in range(0,len(objectlist)): objectlist[index]=objectlist[index][0].swapcase()+objectlist[index][1:] itemcounter=denunciation(objectlist,itemcounter,1) objectlist.reverse() print '\n'+itemcounter*'\t'+'But in this moment . . .\n' repunct(objectlist) for item in objectlist: itemcounter-=1 print itemcounter*'\t'+item+' become me.' copylist=[] for item in objectlist: copylist.append(item) random.shuffle(copylist) newlist=[] for item in copylist: newlist.append(item[4].upper()+item[5:]+'.') for item in newlist: print '\n',itemcounter*'\t',item, itemcounter+=1 print '\n\n'+itemcounter*'\t'+'But I will be unhappy if I forget . . .\n' objectlist.reverse() repunct(objectlist) itemcounter=denunciation(objectlist,itemcounter,-1) print '\n\n# Like any good poet, I bare my own innards below:\n\n' print myinnards_exposed # This is software that composes a Buddhist sutra "renunciation poem" "on-the-fly". # It further displays it's own source code as above. If you run the code above in a Python compiler, # you will get a different, but similarly-ruled poem. Interestingly, the Artificial Intelligent "author" # reflects on her own process at the end of the poem by displaying her own innards (Including this commentary).
honestpoet said
What a wonderful Festivus/Last-Day-of-Tree-of-Life/Christmas-Eve-Eve gift, my love! These ARE wise remembrances, and your gift is most gratefully received. And the recursive nature of the poem/program, and its philosophical implications (not only re: wise living, but re: the nature of mind and poetry) strike me as very groovy.
And if this rather over-tagged first-post of my husband (I made a username for him, so he can actually contribute here, despite the fact that he has no desire whatsoever to blog or write, except in spasms of poetry every few years) does what he wished, and brings a bunch of computer geeks & other newcomers to my door, I say to you all, welcome! I’m glad you’re taking a look. Please feel free to post any comments, on posts new or old.
majutsu said
Concept art being what it is, elucidation of the concept behind the art is often important. Here is the idea at work in this art event.
First is the setting. Being quite a fan of Sasha Shulgin, I was investigating the 2-C phenylethylamines. The (in retrospect) mis-guided plan was to take a low dose to allow the amphetamine part of the phenylethylamine to predominate, so as to do work. I was to finish programming the finishing touches on a large patient database. Being of the “if one’s good, two’s gotta be better school” and having a sub-therapeutic dose available, I augmented with a natural MAOI. Overshot. Again. Ended up with open eye visuals of breasts and legs and claws and teeth in Escher like weaves of pastel thought-space. Furthermore a tremendous feeling of sadness, anxiety and internal agitation dominated especially while ruminating on loss of job, loss of friends and loved ones, loss of tens of thousands of dollars . . . I could not find peace until I realized that I am not this, I am not that. No matter what I lose, I have a core, to survive, to love, to breathe, to f@ck, to experience life in full, happy and sad. I realized too I had been standing still for at least 10 minutes with hands folded, and was therefore de facto praying or meditating. This was clearly a creative act, one I wanted to capture. I thought then, what is creativity, but a process wherein we grow in knowledge and share the journey of our growth in an artificial process, called a media. I had always pursued music and poetry as art, and programming, science, and medicine as jobs. But jobs, and life, and love and choices are too creative acts. I was going to use the computer to model the creative act.
Psychedelics and religious practices are designed to focus one upon the peaceful center beyond pain, anxiety and, ultimately our impermanence and powerlessness. I would select images from my psychedelic space and discard them as essential to the viewer. This produced an increased sensation of lightness and freedom from fear. I decided how this process would take the poisons, first discarding them, then owning them in the I. Then I would focus on how the objects while not essential, once created build up a story, a narrative of who I am. They become a me. Then I would again discard them, showing how life is a delicate balance between the world-free and the world-made me. DMT is the fundamental psychedelic. It is sprinkled through every kingdom, a thread woven throughout all life. This very awareness, DMT, the spirit molecule, is that all life is what it is at that time, but never just what it is, or nothing would survive change. DMT floods the human brain, and is responsible for the tunnel of light hallucinations and near-death experiences. It is also the chemical that makes us trip our dreams. It is the very stuff of art, dreams, and spirit. This artificially intelligent author manipulates objects and the rules of syntax for English (in a limited sense) so as to produce a documentation of the computer author as being and non-being. The true artist also reflects on her own process, and this is how we learn who we are and what we can be through art. The program portrays its own rules as part of the footprint of it’s work of art. If the program were to start to add its own images based on criteria from web searches and write changes to its own code as to syntax manipulation, it would truly become it’s own independent artist. The fact that the images come from random extractions of psychedelic and experiential space, make it little different then a random or computer criteria-based object list. So in reality, the AI poet can be said to be it’s own author, for like any student, it’s path to independence is clear and realizable. The point is to show that art and science are not distinct, but will clearly meld in the future. Technology is who we are now, and art always reveals who we are and what we are becoming. Art and psychedelics like this are outlawed by all governments of the world because the development of new symbols, new processes, new expressions of who we are and who we want to be, will no doubt shatter the economically-abused and symbolically-controlled roles we fulfill now for monetary and ego gratifying sadomasochistic roles of those we serve in slavery.
honestpoet said
You know, I’ve seen now the alleged poem written in 2006, also in python, but I have to say that what that other guy did isn’t much of a poem. I could take both to a workshop and see what the other poets think? This might get interesting.