infile = open('dictionary.txt', 'r')
for line in content:
First off, instead of opening and closing the files explicitly you can use
with statement for opening the files which, closes the file automatically at the end of the block.
Secondly, as the file objects are iterator-like objects (one shot iterable) you can loop over the lines and split them with
: character. You can do all of these things as a generator expression within
with open('dictionary.txt') as infile: my_dict = dict(line.strip().split(':') for line in infile)