[IPython-User] Controlling iPython output when starting notebook

Matthias BUSSONNIER bussonniermatthias@gmail....
Wed Aug 29 11:01:15 CDT 2012

Le 29 août 2012 à 17:49, Spencer Ogden a écrit :

> Ihave multiple users with logins on a shared Linux server. I would like 
> to make using iPython as easy as possible by starting up a notebook as 
> soon as they log in. This part is fine, what I would like to do is have 
> less output from iPython, just a simple line saying "Go to: 
> http://server:port" (there's no gui, so auto starting a browser doesn't 
> make sense).
> I am trying to capture the STDERR output of iPython, and grep that for 
> the port number, but I'm not having much success. Any help is 
> appreciated. Also, I may be approaching this problem in completely the 
> wrong way.

Why not specifying the port number, let's say a prefix 8888+userid with the --port option ?
This would moreover allow user to bookmark it .

> The following lines work when I execute them sequentially in bash, but 
> not when I source the .bash_profile. The server starts, but $port is not 
> assigned. The sleep is there to give ipython time to print to the file.
> ipython notebook --profile=personal &> 
> ~/.ipython/profile_personal/log/personal_session.log &
> port=$(grep -o "[0-9]*" 
> ~/.ipython/profile_personal/log/personal_session.log)
> sleep 5
> echo $port
> echo "Go to http://portcon:$port"
> Spencer
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user

More information about the IPython-User mailing list