SELECT
class,
COUNT(rang) == SUM(rang > 4)
FROM students
GROUP BY
class
def main():
modules = []
class_name = args.get('class_name')
init_args = args.get('init_args')
prep_args = args.get('prep_args')
file_name = args.get('file_name')
modules_file = import_module(file_name)
module_class = getattr(modules_file, class_name)
module = module_class(**init_args)
module.prepare(**prep_args)
modules.append(module)
for module in modules:
module.start()
if __name__ == "__main__":
main()
class MovingDataTranslator(object):
def __init__(self, core):
super().__init__()
self.core = core
self.killed = False
self.labels = {}
self.grid = QGridLayout()
self.core_screen = core.main_screen
def kill(self):
self.killed = True
def prepare(self, telemetry, lbl_name_params, lbl_value_params, x, y):
self.telemetry = telemetry
self.widget = QWidget(self.core_screen)
self.widget.move(x, y)
def start(self):
update_thread = threading.Thread(target=self.update, args=())
update_thread.start()
def update(self):
while not self.killed:
for k in self.telemetry:
res = get_from_telemetry(self.core, self.telemetry[k])
self.labels[k].setText(str(res))
time.sleep(0.01)
или с помощью оконных функций и делают скользящее среднее?
знаешь как это вообще сделать?
ps: использую clickhouse