code: def wr_py_nts(fout_py, nts, docstring=None, varname="nts"):
      
      if nts:
          with open(fout_py, 'w') as prt:
              prt.write('"""{DOCSTRING}"""\n\n'.format(DOCSTRING=docstring))
              prt.write("# Created: {DATE}\n".format(DATE=str(datetime.date.today())))
              prt_nts(prt, nts, varname)
              sys.stdout.write(" {N:7,} items WROTE: {PY}\n".format(N=len(nts), PY=fout_py))
docs: Save namedtuples into a Python module.