print.py

#!/usr/bin/python
import cexmlhelper
import os
import sys
cexmlhelper.set_linux_classpath()
# process the first commandline argument (which should be a file)
# with the print_answer.xslt stylesheet
temp=cexmlhelper.process_with_xslt("%s"%sys.argv[1],"print_answer.xslt")
# Call the xml.apache FOP processor on the commandline
os.system("java org.apache.fop.apps.CommandLine %s answer.pdf"% temp)
# print the resulting PDF file
os.system("lpr answer.pdf")