我在notebook中使用tqdm(从tqdm.auto导入tqdm),输出效果很好,但是当在终端运行脚本时,同一行代码会产生混乱的多行输出。有没有办法让tqdm区分notebook和终端输出呢?
你应该尝试使用
from tqdm.autonotebook import tqdm