擅长:python、mysql、java
<pre><code>import csv
with open(<path-to-file>, "w") as the_file:
csv.register_dialect("custom", delimiter=" ", skipinitialspace=True)
writer = csv.writer(the_file, dialect="custom")
for tup in tuples:
writer.write(tup)
</code></pre>
<p><a href="http://docs.python.org/library/csv.html#csv-fmt-params" rel="noreferrer">^{<cd1>}</a>模块非常强大!</p>