Python Scripting

The Python programming language is embedded inside PFC and FLAC3D. Python is a general purpose programming language with good support for scientific and numerical programming. Python has been extended to allow PFC models to be manipulated from Python programs.

Note

  • The FISH programming environment is still available.
  • Python has the advantage of being faster, easy to use and has additional functionality.
  • An important difference between the Python and FISH programming environments is that the Python state is not connected to the model state or saved in the save files. When a model new or model restore command is given the FISH programming state is cleared or restored. The Python state is not affected by the model new or model restore commands and the Python state is not saved in save files.
  • Giving the command python-reset-state false changes this behavior so the Python state is not cleared by the model new or model restore commands. The tutorials and examples here all assume that this command has been given and that the Python state persists after calls to model new or model restore commands.