1
我有一個文本文件(example.txt中),它看起來是這樣的:修改參數在現有文本文件與Python
sn = 50
fs=60
bw=10
temperature=20
ch=10
rx_b_phase = 204c7a76
rx_b_gain = 113
tx_b_phase = 01ff03e1
tx_b_gain = 105
#sample_gain
sample_gain_hi = 7dc
sample_gain_mid = 7d0
sample_gain_low = 7c9
psl = 44
pin = -1728
#tmpr_reg temperature,pa_reg,wfp_reg
tmpr_reg = 1,d4,1b
tmpr_reg = 6,d3,1b
tmpr_reg = 12,d2,1b
tmpr_reg = 17,d1,1b
我需要修改/更新下列參數:rx_b_phase
,sample_gain_hi
沒有改變任何東西。我如何用Python來做到這一點? 非常感謝,