我有一个更新实时值的类:
class LiveUpdate():
def __init__(self):
self.x=0
self.t1 = threading.Thread(target=self._refresh_value)
self.t1.start()
def _refresh_value(self):
while True:
self.x=self.x+1
updater=LiveUpdate()
@xw.func
def return_live_x():
return updater.x
当我将return_live_x作为一个UDF调用时,如何使它在excel中连续返回1、2、3、4等?在
如果Excel决定重新计算或按键手动重新计算,则会调用自定义项。在
不知道是否可以使用
xlwings
在后台永远启动并运行Python脚本。在我可以想象以下未经测试的代码:
相关问题 更多 >
编程相关推荐