Created
March 11, 2020 09:34
-
-
Save cpjobling/3ffdbe4127d14a9af8d3f320e5837c5d to your computer and use it in GitHub Desktop.
A script to launch a jupyter-notebook from WSL. By @AEIjarret here: https://github.com/jupyter/notebook/issues/4594#issuecomment-531582115 with this addition https://github.com/jupyter/notebook/issues/4594#issuecomment-562715818
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# I need to source conda | |
source ~/anaconda3/bin/activate base | |
# Find the interesting output in stderr | |
mycmd='jupyter notebook --no-browser' | |
exec 3< <($mycmd 2>&1) | |
a=$(grep -o -m1 'http://localhost.*' <&3) | |
echo $a | |
# Use preferred browser here - needs | |
wlsview "$a" | |
# This keeps the terminal alive as we get the rest of the output | |
cat <&3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment