StatsReporting / stargazer

Python implementation of the R stargazer multiple regression model creation tool
Other
197 stars 48 forks source link

Option to write render_html or render_latex output to a file #29

Open MaxGhenis opened 4 years ago

MaxGhenis commented 4 years ago

This is especially helpful for render_latex, since a common workflow is to store each tex component as separate files, and then include them in the master tex file. It'd be nice to have a render_latex(out='out.tex') option.

Current workaround (which would probably be the way to implement the feature) is:

f = open("out.tex", "w")
f.write(stargazer.render_latex())
f.close()
toobaz commented 4 years ago

Current workaround (which would probably be the way to implement the feature) is:

Just for the records, you can spare one line:

with open("out.tex", "w") as f:
    f.write(stargazer.render_latex())

... but sure, this would be nice to have.