You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- """ Functions for python system.
- """
-
- def isNotebook():
- """check if code is executed in the IPython notebook.
- """
- try:
- shell = get_ipython().__class__.__name__
- if shell == 'ZMQInteractiveShell':
- return True # Jupyter notebook or qtconsole
- elif shell == 'TerminalInteractiveShell':
- return False # Terminal running IPython
- else:
- return False # Other type (?)
- except NameError:
- return False # Probably standard Python interpreter
|