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
评论列表
文章目录