helpers.py 文件源码

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

项目:spikefuel 作者: duguyue100 项目源码 文件源码
def start_jaer(jaer_path, jaer_exec="jAERViewer1.5_linux.sh"):
    """Start jAER from Python.

    This script is written for Linux usage,
    An error will be raised if it's Windows OS.
    Instead, windows user needs to manually setup jAER.

    Parameters
    ----------
    jaer_path : string
        absolute save path of jAER.
        e.g. /Users/dgyHome/Documents/workspace/jaer/trunk
    jaer_exec : string
        The executable of jAER. Version 1.5 is assumed.

    Returns
    -------
    An opened jAER viewer.
    """
    # Check OS type
    if os.name != "posix":
        raise ValueError("The Operating System is not a POSIX platform")

    commands = "cd "+jaer_path+"; bash "+jaer_exec
    process = subprocess.Popen(commands, stdout=subprocess.PIPE, shell=True)

    return process
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号