You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.
When using a notebook, it makes more sense to record the cell number than the name of the file. It might be possible to:
automatically detect if using a notebook environment
defis_notebook():
try:
shell=get_ipython().__class__.__name__ifshell=="ZMQInteractiveShell": # pragma: no cover# Jupyter notebook or qtconsolecfg=get_ipython().confignb=len(cfg["InteractiveShell"].keys()) ==0returnnbelifshell=="TerminalInteractiveShell": # pragma: no coverreturnFalse# Terminal running IPythonelifshell=="Shell": # pragma: no coverreturnTrue# Google Colab notebookelse:
returnFalse# Other type (?)exceptNameError:
returnFalse# Probably standard Python interpreter
return cell number instead of file name if so (using get_ipython().execution_count)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When using a notebook, it makes more sense to record the cell number than the name of the file. It might be possible to:
get_ipython().execution_count
)The text was updated successfully, but these errors were encountered: