Skip to content

Instantly share code, notes, and snippets.

@roskakori
roskakori / writexml.py
Created July 7, 2012 19:37
Different variants of writting XML in Python
# -*- coding: utf-8 -*-
'''
Example code to write large output in XML with Unicode and namespaces.
This code has been referenced in a lightning talk I gave at EuroPython 2012
in Florence.
'''
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
@roskakori
roskakori / essentials.py
Created May 17, 2012 11:01
Python essentials
'''
Python 2.x essentials.
This requires Python 2.5 or later.
'''
from __future__ import with_statement
import codecs
import os