I have a long string of values in text file
[(3.7811269080692846, 0, 1), (3.7811269080692846, 1, 0), (3.7698643400208622, 1, 2), (3.7698643400208622, 2, 1)]
And I wish to print every parenthetical on a separate line in the format like this
[(3.7811269080692846, 0, 1),
(3.7811269080692846, 1, 0),
(3.7698643400208622, 1, 2),
(3.7698643400208622, 2, 1)]
Here is how I print this to the file
f = open('contact.txt', 'w')
f.write(str(z))
f.close()
What would be an easy way to print the file in my desired format?