molfoundry.include#
- molfoundry.include(fName, checkDup=True, putDup=True, skipDup=True)#
Execute another MolFoundry script in the caller’s namespace.
Reads
fName(afterprefixFilename()prefixing) and executes it in the calling module’s global namespace, so its top-level definitions become available to the includer – textual inclusion, notimport. While the file runs, its directory is pushed onto the prefix stack so that relative filenames inside it resolve relative to that file.- Parameters:
fName (str | CWDPath) – Path to the script to include, relative to the including file (or absolute, or a
CWDPathto make it relative to the working directory instead).checkDup (bool) – When
True(the default), consult the record of already included files and act perskipDupif this file was seen.putDup (bool) – When
True(the default), record this file so later includes of it are recognized as duplicates.skipDup (bool) – When
True(the default), silently skip a file that was already included; whenFalse, re-inclusion raises.
- Raises:
LogicError – If
checkDupandskipDupisFalseand the file has already been included.- Return type:
None