pfiles.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:chandra-acis-analysis 作者: liweitianux 项目源码 文件源码
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"]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号