I have a scripts that contains lots of print statements along the process, here is an example:
import pandas
print "pandas library imported"
df = pd.Dataframe(...)
print "df created."
print "There are {0} rows and {1} columns in the data frame".format(df.shape[0], df.shape[1])
...
So is there a way that I can put all the print statements in a log file?