def setup_pfiles(tools):
"""
Copy the parameter files of the specified tools to the current
working directory, and setup the ``PFILES`` environment variable.
Parameters
----------
tools : list[str]
Name list of the tools to be set up
"""
for tool in tools:
pfile = subprocess.check_output([
"paccess", tool
]).decode("utf-8").strip()
subprocess.check_call(["punlearn", tool])
try:
shutil.copy(pfile, ".")
except shutil.SameFileError:
pass
# Setup the ``PFILES`` environment variable
os.environ["PFILES"] = "./:" + os.environ["PFILES"]
评论列表
文章目录