#! /usr/bin/python import subprocess from xml.sax import parse from xml.sax.handler import ContentHandler proc = subprocess.Popen("cat toto.xml".split(), stdout=subprocess.PIPE) parse(proc.stdout, ContentHandler())