OOF2: The Manual


OOF.File.Save.Python_Log — Save the current session as a Python script.




  • Parent Menu: OOF.File.Save
  • Callback: function saveLog in module ooflib.common.IO.mainmenu
  • Options: no_log=1
  • Parameters:

    Name of the file. Type: A character string.
    Whether to overwrite or append to an existing file. Type: An object from the WriteMode enumerated class.


At any point in an OOF2 session, one can save a log file of all of the commands that have been executed. The file is a Python script. Subsequently loading the file with OOF.File.Load.Script or with the --script command line argument will recreate the OOF2 session.

[Note] Note

Loading a saved script may not exactly reproduce an OOF2 session if the script contains commands that use the random number generator, such as many of the Skeleton modification methods. The randomness of the random number generator can be made predictable (on a given computer) by always using the --seed command line argument, but of course then the numbers aren't truly random.

[Note] Note

Saving and reloading a log file is an inefficient way of restoring an OOF2 session, because each command is re-executed when the file is loaded. It is more efficient to use the other commands in the OOF.File.Save menu to save the objects (Microstructures, Skeletons, and Meshes) that OOF2 creates.