File size: 303 Bytes
bddc905
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
def clear_stdout():
    '''
    Attempts to clear stdout, whether running in a notebook (IPython) or locally
    in a Unix envirnoment.
    '''
    try:
        from IPython.display import clear_output
        clear_output(wait=True)
    except ImportError:
        import os
        os.system("clear")