我正在编写一个ableton python 脚本。这个将字符串写入文件:
class LaunchControl(ControlSurface):
def __init__(self, c_instance):
super(LaunchControl, self).__init__(c_instance)
f = open("d:\members2.txt", "w")
f.write('START ok\n\n')
f.flush()
但是这个没有,我在日志中看不到任何错误。唯一的区别是最后一行:
class LaunchControl(ControlSurface):
def __init__(self, c_instance):
super(LaunchControl, self).__init__(c_instance)
f = open("d:\members2.txt", "w")
f.write('START ok\n\n')
f.flush()
self.f = f
我想在 LaunchControl 类的其他功能中使用 f