Feb-22-2020, 04:36 AM
do anyone know how to print the result from the iperf log, test111.txt.
Do anyone have any idea on how to print the iperf log.
i wish to print like this:
Cycle: 0
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-10.00 sec 11.0 GBytes 9.46 Gbits/sec sender
[ 5] 0.00-10.00 sec 11.0 GBytes 9.46 Gbits/sec receiver
Cycle: 1
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-10.00 sec 11.3 GBytes 9.68 Gbits/sec sender
[ 5] 0.00-10.00 sec 11.3 GBytes 9.68 Gbits/sec receiver
Do anyone have any idea on how to print the iperf log.
i wish to print like this:
Cycle: 0
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-10.00 sec 11.0 GBytes 9.46 Gbits/sec sender
[ 5] 0.00-10.00 sec 11.0 GBytes 9.46 Gbits/sec receiver
Cycle: 1
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-10.00 sec 11.3 GBytes 9.68 Gbits/sec sender
[ 5] 0.00-10.00 sec 11.3 GBytes 9.68 Gbits/sec receiver
import subprocess import os input11= 5 input_no=input("Please enter cycle: ") if input_no =='': input_no=input11 for n in range(int(input_no)): command="iperf3 -c localhost --logfile test111.txt\n" p=subprocess.Popen(command, shell=True) print("Cycle:",n) p.wait()