src/jpyEDM_v0.py
def Notebook():
    '''Determine if Jupyter notebook is the parent process'''
    try:
        ipython = get_ipython().__class__.__name__
        if 'ZMQInteractiveShell' in ipython:
            return True   # Jupyter notebook or qtconsole
        elif 'TerminalInteractiveShell' in ipython:
            return False  # Terminal running IPython
        else:
            return False  # Other type (?)
    except NameError:
        return False      # Probably standard Python interpreter
Determine if Jupyter notebook is the parent process
Determine if Jupyter notebook is the parent process
Determine if Jupyter notebook is the parent process
def Notebook():
    try:
        ipython = get_ipython().__class__.__name__
        if 'ZMQInteractiveShell' in ipython:
            return True   
        elif 'TerminalInteractiveShell' in ipython:
            return False  
        else:
            return False  
    except NameError:
        return False      
def Notebook ( ) : try : ipython = get_ipython ( ) . __class__ . __name__ if 'ZMQInteractiveShell' in ipython : return True elif 'TerminalInteractiveShell' in ipython : return False else : return False except NameError : return False
Determine if Jupyter notebook is the parent process
Determine if Jupyter notebook is the parent process
'''Determine if Jupyter notebook is the parent process''' # Jupyter notebook or qtconsole # Terminal running IPython # Other type (?) # Probably standard Python interpreter