我有两个功能:
1)a = f(w) = w+1 , wait(.5 sec)
2)w = g(A) = mean(A)+1, wait (30 sec)
我必须编写一个python函数: 初始化
w = 1
A = []
1) Runs a = f(w) after every 1 sec. and append: A.append(a)
2) Runs w = g(A) after every 1000 sec.
我们可以在上面看到g(A)执行超过30秒(等待30秒)。因此,我们不想在运行a = f(w)之前等待w = g(A)完成。只需使用w的最新值即可运行,即a = f(w)
您能帮忙编写此功能吗?