79752498

Date: 2025-09-01 12:19:45
Score: 0.5
Natty:
Report link

For a notebook in VSCode, following will give you the notebook name. No need to import anything additional

notebook_name = os.path.basename(globals().get('__vsc_ipynb_file__', 'unknown_notebook')).replace('.ipynb','')
print(f"Notebook name: {notebook_name}")
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Abhishek Sourabh