Skip to content

Instantly share code, notes, and snippets.

@galois17
Created October 14, 2022 21:50
Show Gist options
  • Save galois17/ba17753b48f0e29c6afa6efd04dddb27 to your computer and use it in GitHub Desktop.
Save galois17/ba17753b48f0e29c6afa6efd04dddb27 to your computer and use it in GitHub Desktop.
Check Jupyter kernel mapping
import os
from jupyter_client import kernelspec
kernel_name = '<kernel_name>'
spec = kernelspec.get_kernel_spec(kernel_name)
print(spec.resource_dir)
json_name = 'kernel.json'
full_path = os.path.join(spec.resource_dir, json_name)
with open(full_path, 'r') as file:
data = file.read()
print(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment