Printing Reached MSF(Safety Factor) using Python Scripting

I have prepared python scripting code to calculate the safety factor using monte carlo simulations of different strength parameters.  I want to know how can I can print the safety factor values  (after each simulation has been completed) in excel format for all simulations that can help me understand the distrubution of safety factor values.