I have a GUI program in Python which calculates graphs of certain functions. These functions are mathematical like say, cos(theta) etc. At present I save the graphs of these functions and compile them to PDF in Latex and write down the equation manually in Latex. 
But now I wish to simplify this process by creating a template in Latex that arranges, The Function Name, Graph, Equation and Table and complies them to a single PDF format with just a click. 
Can this be done? And how do I do it? 
Thank you.
generate a Latex file.tex with a Python script 
f= open("file.tex", 'w')
f.write('\documentclass[12pt]{article}\n')
f.write('\usepackage{multicol}\n')
f.write('\n\begin{document}\n\n')
...
f.write('\end{document}')
f.close()
run pdflatex on the LaTex file from the Python script as a subprocess
subprocess.call('latex file.tex')

As an alternative to 1. you can generate a LaTex template and just substitute the variable stuff using Python regular expressions and string substitutions.
Python Export Program to PDF using Latex format