On 10/14/2010 7:48 AM Ara Kooser said...
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]
PIDS[ID] = proteinVals
print PIDS
for line in xml:
ID = proteinVals.split()[1]
rslt = "%s,%s"% (line,PIDS[ID])
print rslt
Without reading much further, what happens when you use the loop
variable here instead of the prio loop variable?
Change the second line to
ID = line.split()[1]
and see what you get.
Emile
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor