With some small modifications, your scaript can become a valid Larch script like this:
from os.path import join, expanduser
fname = join(expanduser(‘~'), '/xraylarch/examples/feffit/feff0001.dat')
path1 = feffpath(fname)
path2chi(path1)
show(path1)
newplot(path1.k, path1.chi*path1.k**2, xlabel=r' $ k \rm\, (\AA^{-1})$',
ylabel=r'$ k^2\chi(k)$', label = r'$\sigma^2 = 0$', show_legend=True,
title=r'$\chi(k)$ from %s' % fname)
path1.sigma2 = 0.002
path2chi(path1)
plot(path1.k, path1.chi*path1.k**2, label = r'$\sigma^2 = 0.002$')