def kernel_conda(kernel):
"""Run which conda in the test fixture kernel using Jupyter console."""
jupyter = pexpect.spawn('jupyter', [
'console',
'--kernel', kernel.name]
)
jupyter.expect('In.*:')
jupyter.sendline('!which conda')
# input echo
jupyter.readline()
# path output
path = jupyter.readline()
jupyter.close()
return path.decode('utf-8')
评论列表
文章目录