1 def isnotebook():
2 try:
3 shell = get_ipython().__class__.__name__
4 if shell == 'ZMQInteractiveShell':
5 return True # Jupyter notebook or qtconsole
6 elif shell == 'TerminalInteractiveShell':
7 return False # Terminal running IPython
8 else:
9 return False # Other type (?)
10 except NameError:
11 return False # Probably standard Python interpreter
-
W293
Blank line contains whitespace
12
-
W293
Blank line contains whitespace
13
-
W293
Blank line contains whitespace
-
W292
No newline at end of file
14