How to retrieve the pressure at each node of a network after each time step of a hydraulic analysis

Hello,

I found an example code of retrieving the pressure at each node of a network after each time step of a hydraulic analysis shown below:
example%20code
But I am new to python, I don’t know how to convert the example code to python code.
Could you please give me ideas?
Thank you very much!