See if the following is useful,
import originpro as op
wb = op.new_book()
wks = wb[0]
fn=op.path('e') + 'Samples\Curve Fitting\Linear Fit.dat'
wks.from_file(fn,False)
wb.lt_exec('fitlr (A,D)')
intercept=op.lt_float('fitlr.a')
slope=op.lt_float('fitlr.b')
print(f'slope={slope} intercept={intercept}')
It will fit A(x) D(y).
To find details on the FitLR X-Function, you type into Origin script window
fitlr -h
Any XF execution will create a LabTalk Tree of the same name, so after the fit, you can find the full tree by
firlr.=
from script window.
CP