close
import os
import time
from Image_complexity_final import cal_csv_entropy
def is_in_notebook():
    import sys
    return 'ipykernel' in sys.modules
def clear_output():
    """
    clear output for both jupyter notebook and the console
    """
    os.system('cls' if os.name == 'nt' else 'clear')
    if is_in_notebook():
        from IPython.display import clear_output as clear
        clear()
因為tqdm不太會用所以找了這個方法來用
我使用的方法是
在每次執行print前呼叫
clear_output()
就可以清除jupyter notebook上的輸出,但是太頻繁的print會造成閃爍,我使用一個計數器,次數到了才清除並更新輸出..








arrow
arrow

    低階ㄇㄋ 發表在 痞客邦 留言(0) 人氣()