I am taking real time measurements from an ADC in a while loop, so I print one line at a time. For example,
while True:
{measure data}
table=[[148, 36, 22.558593749999993, 0.20431640624999997, 0.0012890625]] # one row of data
table_header = ["dac_value, adc_value, current_mA, V_gate, V_source"]
print(tabulate(table, table_header))
The output looks like:
dac_value adc_value current_mA V_gate V_source
----------- ----------- ------------ -------- ----------
148 36 32.2266 1.9433 0.0129
dac_value adc_value current_mA V_gate V_source
----------- ----------- ------------ -------- ----------
148 36 64.4531 1.9433 0.0097
dac_value adc_value current_mA V_gate V_source
----------- ----------- ------------ -------- ----------
148 36 96.6797 1.9433 0.0129
dac_value adc_value current_mA V_gate V_source
----------- ----------- ------------ -------- ----------
148 36 161.133 1.9433 0.0129
Is there a way to make it look like:
dac_value adc_value current_mA V_gate V_source
----------- ----------- ------------ -------- ----------
148 36 32.2266 1.9433 0.0129
148 36 64.4531 1.9433 0.0097
148 36 96.6797 1.9433 0.0129
dac_value adc_value current_mA V_gate V_source <-- add this header every nth line of data
----------- ----------- ------------ -------- ----------
148 36 161.133 1.9433 0.0129
I know I could do this in my while loop (i.e. only print the data after every n rows of data is collected), but then I am not looking at the data in real time.
Thanks!
I am taking real time measurements from an ADC in a while loop, so I print one line at a time. For example,
The output looks like:
Is there a way to make it look like:
I know I could do this in my while loop (i.e. only print the data after every n rows of data is collected), but then I am not looking at the data in real time.
Thanks!