Hey, i am new to python. I am making a translator in python 2.6 using basic commands. The translator is english to german. I need to use a i need to use a text file like this...
at an
brown braun
cat raze
etc.
so far i have created lists inside a list which i hope will help me. If anyone has any ideas if im on the right track or can tell me how to finish the code it would be appreciated
the code so far is...
fin = open("english2german.txt", "r")
data_list = fin.readlines()
fin.close()
data_list = [item.rstrip('\n') for item in data_list]
data_list = [item.split('\t') for item in data_list]
print data_list
this gives...
[['at', 'an'], ['brown', 'braun'], ['cat', 'raze'], ['dog', 'hund'], ['down', 'huegelland'], ['end', 'ende'], ['exit', 'abfahrt'], ['fever', 'fieber'], ['fox', 'fuchs'], ['he', 'er'], ['i', 'ich'], ['in', 'in'], ['is', 'ist'], ['it', 'es'], ['jumps', 'abspruenge'], ['lazy', 'lustig'], ['mainly', 'hauptsaechlich'], ['mat', 'matte'], ['not', 'nicht'], ['on', 'an'], ['over', 'uber'], ['plain', 'blanko'], ['quick', 'schnell'], ['rain', 'regen'], ['sat', 'sitz'], ['she', 'sie'], ['spain', 'spanien'], ['start', 'anfang'], ['the', 'der'], ['up', 'auf']]