<p><br>
On Aug 9, 2012 9:17 PM, <<a href="mailto:giuseppe.amatulli@gmail.com">giuseppe.amatulli@gmail.com</a>> wrote:<br>
><br>
> Hi,<br>
> I have a dict() unique<br>
> like this<br>
> {(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2}<br>
> and i want to print to a file without the brackets comas and semicolon in order to obtain something like this?<br>
> 4 5 1<br>
> 5 4 1<br>
> 4 4 2<br>
> 2 3 1<br>
> 4 3 2<br>
> Any ideas?<br>
> Thanks in advance</p>
<p>How's this?</p>
<p>from __future__ import print_function</p>
<p>output = open("out.txt", "w")</p>
<p>for (a, b), c in d.items():<br>
print(a, b, c, file=output)</p>
<p>output.close()</p>
<p>Oscar.<br>
> --<br>
> <a href="http://mail.python.org/mailman/listinfo/python-list">http://mail.python.org/mailman/listinfo/python-list</a><br>
</p>