Create kml from csv in Python
use etree to create your file
http://docs.python.org/library/xml.etree.elementtree.html
It's included with Python and protects you from generating broken XML. (eg. because fname
contained &
, which has special meaning in XML.)
You didn't answer the query above, but my guess is that the error is that you're not closing your output file (which would flush your output).
f.close()