How would I make a dictionary that has keys that represent not just a single string, but multiple strings (array)? So each key is tied to an array that I can keep appending new strings to if the key is present in another file?
I am a relatively new Python programmer so I can visualize how my script would work... but alas I can't think of the proper syntax.
I have the logic down (I think), I just need help with which modules or functions to use in Python. I am about 3/4 the way through Learn Python the Hard Way by Zed Shaw, if you need a reference to my current knowledge in Python.
Lets get to it. Example:
File 1:
A
B
C
D
File 2:
Ted A
Mike A
Wilma B
Frank C
Dog D
Fred D
File 3:
Jon Ted
Sid Ted
Mic Mike
Will Dog
Tod Dog
Hopeful Result (write to File 4):
>A Ted Mike Jon Sid Mic
>B Wilma
>C Frank
>D Dog Fred Will Tod
So using file 1 for the keys we can fill the elements with file 2 and 3 if the key is present. Notice in file 2 A and D have multiple answers. Next look into file 3 and we expand even further; we also see that Jon and Sid(file3) = Ted(file2) = A. A also = Mike (file2) = Mic (file 3)
This is the simplest example of my data (100,000's of sequences), and the real kicker is I have five hierarchically expanding files, not just 2 (example above).
~~~ Answered ~~~
Thank you F.J and others