[Tutor] awk, test

2009-08-14 Thread Vincent Wan
Hi Todd, Did you get your searches running? Have you had a chance to look at my exam? Are you planning to go next door for beer some day next week? If so, do you know when. I'd like to stop by and chat. Best, Vincent --

Re: [Tutor] Help with objects

2005-11-21 Thread Vincent Wan
their names are sequential integers if j.alive: if random.random() >= BRANCHING_PROBABILITY: currentTree.AddBranch(j, (currentTree.NumLinages() + 1)) # creates a new node j += 1 Thank you for the help Vincent Wan --

[Tutor] Help with objects

2005-11-21 Thread Vincent Wan
MBER_REPS): j = 0 while j <= currentTree.NumLinages(): # checks all node because their names are sequential integers if j.alive: if random.random() >= BRANCHING_PROBABILITY: currentTree.AddBranch(j, (currentTree.NumLinages() + 1)) # creates

[Tutor] building non binary trees CLARIFIED

2005-11-17 Thread Vincent Wan
n range(NUMBER_REPS): j = 0 while j <= currentTree.NumLinages(): if random.random() >= BRANCHING_PROBABILITY: currentTree.AddBranch(j, currentTree.NumLinages() + 1) j += 1 Vincent Wan -

[Tutor] building nonbinary trees

2005-11-17 Thread Vincent Wan
m() >= BRANCHING_PROBABILITY: currentTree.AddBranch(j, currentTree.NumLinages() + 1) j += 1 thank you, Vincent Wan -- PhD Candidate Committee on the Conceptual and Historical Studies of Science Univ

[Tutor] problem calling a function

2005-11-13 Thread Vincent Wan
Thank you Roel Schroeven I don't know how I missed the fact that the printDendrogram function needs tuples not strings. I didn't recognize that my string was a tuple so I didn't realize that when I pasted it interactively in IDEL I was allowing python to change the type. eval() changes the ty

[Tutor] problem calling a function

2005-11-12 Thread Vincent Wan
if random.random() < EXTINCTION_PROBABILITY: print 'At ', time,' linage ', linages[j], 'died ' del linages[j] if len(linages) == 0: "restarts if fewer that 10 linages evolved"

[Tutor] please help me improve my python style

2005-01-13 Thread Vincent Wan
. Gould # 1974 Systematic Zoology 23: 305-322. # written by Vincent Wan with help from tutor@python.org import random debug = 0# turns debug diagnostic printing on = 1 or off = 0 #constants that control the simulation max_linages = 201# the number of linage to be evolved + 1

[Tutor] sorry, another update bug

2005-01-12 Thread Vincent Wan
sorry to inflict another dumb bug on you all so soon... I have written a program to replicated simulate the evolution of species and their genomes based on David Raup and Stephen Jay Gould's 1974 paper in systematic zoology 23: 305-322. The program correctly evolves species and keeps track of

[Tutor] what's a concise way to print the first elements in a nested list

2005-01-12 Thread Vincent Wan
If I have a list stuff = [[0,sdfsd,wrtew], [1, rht,erterg]] whats the most concise way to print the first elements: [0, 1] if triedprint stuff[:][0] but that just prints the whole list. Vincent -- PhD Cand

[Tutor] TypeError I don't understand

2005-01-12 Thread Vincent Wan
Dear All, python gives me a type error that I don't understand running my program gives me "TypeError: len() of unsized object" but I know I that the object whose length I asked for is a list and therefor a sized type here is a sample of the output: type (living_species) : len(living_species) :

Re: [Tutor] trouble getting a list to update

2005-01-07 Thread Vincent Wan
PROBLEM SOLVED THANK YOU DANNY AND ALAN To recap: My program main loop called two functions one that changed a list and one that printed the list. Turns out that print function was bad. I didn't understand how clever pythons for statement is. I wrote: def write_list(list_to_write, file_name):

Re: [Tutor] trouble getting a list to update

2005-01-06 Thread Vincent Wan
Dear Danny, On Jan 6, 2005, at 12:59 PM, Danny Yoo wrote: Can you show us a snippet of the file output? I'm not immediately seeing anything particular with your debugging output statements: Like the computer, I don't yet understand what the problem is. *grin* If you can point us at the outpu

[Tutor] trouble getting a list to update

2005-01-06 Thread Vincent Wan
return a_genome myfile = open('myfile', 'w') current_time = 0 while current_time < total_time: myfile.write('\nTime is ' + str(current_time) + ' the genome is ') # debug write_list(genome, myfile) leng