Re: [Tutor] Populating a list with object to be called by a class

2012-09-20 Thread Ara Kooser
Oscar, Thanks for that. I feel a bit silly. I forgot about the % which was hanging me up. I am trying to be a better coder. More work ahead for me! ara On Thu, Sep 20, 2012 at 9:01 AM, Oscar Benjamin wrote: > On 20 September 2012 15:41, Ara Kooser wrote: > >> Morning, >> &

[Tutor] Populating a list with object to be called by a class

2012-09-20 Thread Ara Kooser
Morning, I dug out some old code from 5 years ago to clean up and get in working order. It's a simple agent based model. I have class called Ant which contains all the ant-like functions. I have a list that tracks the ants but I did this is a very crude way. I basically copied and pasted everyt

Re: [Tutor] csv DictReader/Writer question

2010-10-21 Thread Ara Kooser
Peter, Thank you for your response. I did try reading the documentation but I missed something (or several somethings in this case). So what I see in the code you supplied is: with open(source, "rb") as instream: reader = csv.DictReader(instream, skipinitialspace=True) destfieldnames = l

[Tutor] csv DictReader/Writer question

2010-10-20 Thread Ara Kooser
Hello all, I have a csv file (from a previous code output). It looks like this: Species2, Protein ID, E_value, Length, Hit From, Hit to, Protein ID2, Locus Tag, Start/Stop, Species Streptomyces sp. AA4, ZP_05482482, 2.82936001e-140, 5256, 1824, 2249\n, ZP_05482482, StAA4_01010003048

Re: [Tutor] Merging Text Files

2010-10-14 Thread Ara Kooser
Hey all, It's mostly solved. The program prints out to the screen just fine except for the new line return. Here is what I ended up using: #Merges two files into one using dictionaries xml = open("final.txt",'r') gen = open("final_gen.txt",'r') PIDS = {} for proteinVals in g

Re: [Tutor] Merging Text Files

2010-10-14 Thread Ara Kooser
Adam, I am going to try and sort through the pseudocode you provided to see if I can get things up and running that way has well. This a part of a larger workflow thing and needs to be in the format that I have. Sticking all this into a database is down the road a ways. *for every line in ONE:

Re: [Tutor] Merging Text Files

2010-10-14 Thread Ara Kooser
Emile, I modified the code to this: for line in xml: ID = line.split()[1] rslt = "%s,%s"% (line,PIDS[ID]) print rslt and ended up with this error: Traceback (most recent call last): File "/Users/ara/Desktop/biopy_programs/merge2.py", line 16, in rslt = "%s,%s"% (line,PIDS[ID]) Ke

Re: [Tutor] Merging Text Files

2010-10-14 Thread Ara Kooser
Morning all, I took the pseudocode that Emile provided and tried to write a python program. I may have taken the pseudocode to literally. So what I wrote was this: xml = open("final.txt",'r') gen = open("final_gen.txt",'r') PIDS = {} for proteinVals in gen: ID = proteinVals.split()[0]

Re: [Tutor] Merging Text Files

2010-10-14 Thread Ara Kooser
Morning all, I took the pseudocode that Emile provided and tried to write a python program. I may have taken the pseudocode to literally. So what I wrote was this: xml = open("final.txt",'r') gen = open("final_gen.txt",'r') PIDS = {} for proteinVals in gen: ID = proteinVals.split()[0]

Re: [Tutor] Merging Text Files

2010-10-13 Thread Ara Kooser
Thank you for all of the advice. I am going to try the dictionary route first thing tomorrow. This code is a part of larger code theat: 1) quires the BLAST database using BioPython 2) parses the data using BioPython, 3) dumps to text files 4) then merges the text files and sorts them. Somewhere do

[Tutor] Merging Text Files

2010-10-13 Thread Ara Kooser
Hello all, I am working on merging two text files with fields separated by commas. The files are in this format: File ONE: *Species, Protein ID, E value, Length* Streptomyces sp. AA4, ZP_05482482, 2.82936001e-140, 5256, Streptomyces sp. AA4, ZP_05482482, 8.03332997e-138, 5256, S

[Tutor] CSV question for getting data from a text file

2009-10-18 Thread Ara Kooser
Hello all, I fell off the python programming wagon for awhile and I am quite rusty. I a text file that looks like this *a bunch of stuff above* O(-2)/O(0) 12.5731 0.7181 Distribution of species

Re: [Tutor] Learning Python (Ara Kooser)

2007-09-29 Thread Ara Kooser
Fred, I've been learning python off and on for a couple years now. I recommend: Alan Gauld's Learning to Program http://www.freenetpages.co.uk/hp/alan.gauld/ and How to Think Like a Computer Scientist http://www.ibiblio.org/obp/thinkCSpy/ Also find a project you are passionate about and try t

[Tutor] remove instances from a list

2007-09-16 Thread Ara Kooser
sts if yeast.isAlive()] to clear out dead yeast. Is the translation for the above line of code into pseudocode? yeast for every yeast in the list yeasts if the yeast method returned isAlive() Or is this meant to be a true or false return? I have included the code below. Thank you again. Ara ##

[Tutor] Killing an instance

2007-09-13 Thread Ara Kooser
I have two instances called and running. They interact with each other and I would like one of the instances to cease to exist in the second round based on a given condition. How do you kill an instance? The code is below. I have Red and Yellow as my instances and I want them to die when lif

[Tutor] Classes: global name not defined

2007-09-12 Thread Ara Kooser
So taking the advice given my John, Kent, and Michael I reworked the program and created a class for world. I was able to solve the first several errors that came up as a I moved functions into class methods but this one stumps me. The error I am getting is: Traceback (most recent call last):

[Tutor] calling class instances in functions

2007-09-11 Thread Ara Kooser
function. I eventually want to add a bunch of different cell classes. Thank you for your help. Ara Kooser Main Program #Yeast Cooperation Model #by Ara Kooser #Version 1.0 no PD, 070906 # #This code contain just the world

[Tutor] More class questions

2007-09-03 Thread Ara Kooser
e #By Ara Kooser #Thanks to Chris, e.,Tino and Steven at python tutor class Player: #What makes this a player. pass #def Move(self): class Area: #What makes it an area? def __init__(self, name, descri

[Tutor] Further into classes

2007-09-01 Thread Ara Kooser
is below but it is not working. I am really sure I am not going about this the right way. Thank you. Ara # #Text Advenuture #By Ara Kooser #Thanks to Chris, e., and Steven at python tutor

[Tutor] Starting classes

2007-08-31 Thread Ara Kooser
Hello, I read Alan Gauld's and How to Think Like a Computer Scientist section on classes. So I tried to write a simple room class. My goal is to write a short text adventure using classes. Here is the code: class Area: def _init_(self, name, description): self.name = name def l

[Tutor] Question about calling functions

2007-08-26 Thread Ara Kooser
o navy(). What I don't understand is why when you have a choose n it won't go back to upp(). Thanks. Ara PROGRAM BELOW ########## # Version:0.3 # By: Ara Kooser ###

[Tutor] Question about classes

2007-08-24 Thread Ara Kooser
uess it doesn't recognize that I want to call the function upp() again. I think I might be using the wrong syntax here. My code is below. Thank you any help or guidance. Ara #########

[Tutor] global question

2007-08-11 Thread Ara Kooser
: #A sample text adventure game using functions #Version 1.0 #By Ara Kooser # import random import sys import string import outside1 import town1 import items

Re: [Tutor] simple list question

2006-02-20 Thread Ara Kooser
Thanks Kent for your help. Right now I am trying to get one room working with just a character and movement. Then on to creatures, multiple rooms and tracking. Ara On 2/20/06, Kent Johnson <[EMAIL PROTECTED]> wrote: Ara Kooser wrote:>>> But really, what are you trying to do?&

Re: [Tutor] simple list question

2006-02-20 Thread Ara Kooser
But really, what are you trying to do?KentI am trying to create rooms/tiles for a roguelike game in python. I have some of the game coded out but I am having trouble with the map and character movement. Ara -- Fatti non foste per viver come bruti, ma per seguir virtute e canoscenza - Dante Aligh

[Tutor] simple list question

2006-02-20 Thread Ara Kooser
Hello all,    First off thank you to all the folks that gave input on a smallpox percolation model my students were working on last year. They won first place in the computation division at the science fair and took home the Intel Programming award. I can post or e-mail the code if anyone wants it