### Navigation

- index
- modules |
- modules |
- next |
- previous |
- FNSS 0.6.1 documentation »
- API Reference »
- Functions »

# fnss.traffic.trafficmatrices.write_traffic_matrix

`write_traffic_matrix`(traffic_matrix, path, encoding='utf-8', prettyprint=True)

  Write a TrafficMatrix or a TrafficMatrixSequence object to an XML file. This function can be use to either persistently store a traffic matrix for later use or to export it to an FNSS adapter for a simulator or an API for another programming language.

  Parameters: | traffic_matrix : TrafficMatrix or TrafficMatrixSequence The traffic matrix to save path : str The path where the file will be saved encoding : str, optional The desired encoding of the output file prettyprint : bool, optional Specify whether the XML file should be written with indentation for improved human readability

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- FNSS 0.6.1 documentation »
- API Reference »
- Functions »