"""
Here's an example of using Python to trigger an external function.  The
string "povray.... " is something you could type at the Linux command line
(i.e. in the Xterm window).  All the little +Letter controlling
"switches" (documented with POV-Ray) govern how it operates:

+V    = verbose output
+W640 = width of 640
+H480 = height of 480
+FN16 = file output in PNG format, color depth 16
+AM2  = use adaptive supersampling
+Q9   = quality (high)
+A0.3 = using anti-aliasing (smooth the jaggies -- takes time, adds clarity)
+L... = path to a library of includable files (colors and textures)
+I    = name of input file (name of output will be same, with .png extension

The last line, os.system(string), passes the string we've built out to the
operating system (os) for execution.

This also works in Windows.  Modify the +L include path to suit.
"""

import os

def render(filename):
    linuxcomm = "povray +V +W640 +H480 +FN16 +AM2 +Q9 +A0.3 +P +L/home/urnerk/include"
    print "Rendering... (this will take some time)"
    os.system(linuxcomm+" +I"+filename)

