thanks, i mistook the [code] for needing to type [python] :)
Also, another friend suggested using strip (i think this is similar to chomp, which i had used in perl) and that has totally solved it- I also had to keep the more complicated while=True loops, it just didn't work otherwise, ?????
User Profile
Collapse
-
Thanks for your help. The program works if I take a few lines of the gigantor input file, beginning, middle or end, so i plan to just chop up the file, and go from there.
I had originally had the program as you suggested, but it didn't work. And now realizing that it was probably the stupid input file from the get go.
Also, wasn't sure how to to the code tags, my bad.Leave a comment:
-
OS X 10.6.5 running python 2.6.1
use gedit for most everythingLeave a comment:
-
Bridget Barker started a topic How to compare 2 files and generate a list of matches, get value error?in PythonHow to compare 2 files and generate a list of matches, get value error?
...Code:f = open("Desktop/MEME_IDS", "r") #open file with list of terms to search for patterns = {} #create an open dictionary (this is a string) while True: line = f.readline() #read each line of file1, put into variable line if (line == ''): #at the end of file, stop break patterns[line] = None #put each line into a list with the key patterns f = open("Desktop/genelistAFUA.txt",
No activity results to display
Show More
Leave a comment: