我想在控制台中输入一些内容,然后立即更新图形。因此我使用pylab交互模式。但是,在输入输入时,Windows控制台会以较短的时间延迟响应,就像交互式绘图使用了太多内存一样。
有没有办法避免这种减速效果?
import pylab as plt
plt.ion() #░interactive mode on
plt.plot([1,2,3])
plt.draw()
while True:
test=str(raw_input('Type something fast and observe the delay\n: '))