Skip to content

Instantly share code, notes, and snippets.

@cfperez
Created September 29, 2016 23:08
Show Gist options
  • Select an option

  • Save cfperez/eae59263a87aba9dbceff1e107e59efc to your computer and use it in GitHub Desktop.

Select an option

Save cfperez/eae59263a87aba9dbceff1e107e59efc to your computer and use it in GitHub Desktop.
Get the kernel name as it appears in htop/ps
from os.path import basename
from IPython import get_ipython
shell = get_ipython()
print(basename(shell.kernel.config.IPKernelApp.connection_file))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment