_nbtools.py 文件源码

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

项目:molPX 作者: markovmodel 项目源码 文件源码
def _molpxdir(join=None):
    r"""
    return the directory where molpx is installed

    :param join: str, default is None
        _datadir(join='myfile.dat') will return os.path.join(_datadir(),'myfile.dat')

    :return: directory or filename where the data for the notebook lies
    """

    import molpx

    if join is None:
        return _os.path.dirname(getfile(molpx))
    else:
        assert isinstance(join,str), ("parameter join can only be a string", type(join))
        return _os.path.join(_os.path.dirname(getfile(molpx)), join)



# For python 2.7 compatibility if we don't want to depend also on backports
# http://stackoverflow.com/questions/19296146/tempfile-temporarydirectory-context-manager-in-python-2-7
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号