Adding to dictionary in a loop while reading file
<p>I am wondering if there is a simple way to add dictionaries in a for loop while reading a file.
I have a file.txt which i want to read it line by line and then add them into a dictionary. 
I tried the below but not able to actually add all the lines as key:value in the same dictionary.</p>

<pre><code>content of file.txt
name1:value1
name2:value2
name3:value3


 with open("file.txt", 'r') as fd:
        for line in fd.readlines():
            d=dict([line.rstrip().split(":")])
            d.update(d)
</code></pre>

<p>Ultimately, i want my dictionary to have something like this:
d = {'Name1': 'Value1', 'Name2': 'Value2', 'Name3': 'Value3'}</p>

<p>Any help is appreciated.</p>