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.

isNotebook.py 527 B

12345678910111213141516
  1. """ Functions for python system.
  2. """
  3. def isNotebook():
  4. """check if code is executed in the IPython notebook.
  5. """
  6. try:
  7. shell = get_ipython().__class__.__name__
  8. if shell == 'ZMQInteractiveShell':
  9. return True # Jupyter notebook or qtconsole
  10. elif shell == 'TerminalInteractiveShell':
  11. return False # Terminal running IPython
  12. else:
  13. return False # Other type (?)
  14. except NameError:
  15. return False # Probably standard Python interpreter

A Python package for graph kernels, graph edit distances and graph pre-image problem.