我该如何实现类似以下的功能:
from tqdm.notebook import tqdm
from matplotlib import pyplot as plt
from IPython import display
import time
import numpy as np
xx = list()
for i in tqdm(range(500)):
xx.append(i * 0.1)
yy = np.sin(xx)
if i % 10 == 0:
display.clear_output(wait=True)
plt.plot(xx, yy)
time.sleep(0.1)
但是当我更新绘图时,如何保持tqdm
进度条不消失?
display.clear_output(wait=True)
这一行吗?或者这不是你想要的吗? - Derek O