Hi,
Thank you for your help in advance, i am trying to create a dictionary, the code below works fine if I have two columns in each row with no spaces, however one of the columns data natively has spaces in it e.g.
Sarah me hy uuuuu
at the moment it works if I do
Sarah me_hy_uuuuu
However this isnt perfect for us. How do I get python to break the data into two columns based on only the first space?
fname = r"C:\blah3.txt"
A_dict = {}
for line in open(fname):
name, score = line.split()
A_dict[name] = str(score)
print (A_dict)
Many Thanks for the help,
Oliver