Harvestに送信 from subprocess import run, PIPE import requests def get_voltage () -> tuple[str, str]: cmd1 = ['sudo', 'sleepi3ctl' , 'get', 'voltage', '1'] cmd2 = ['sudo', 'sleepi3ctl' , 'get', 'voltage', '2'] cp_result1 = run(cmd1, stdout=PIPE, check=True, encoding='utf-8') cp_result2 = run(cmd2, stdout=PIPE, check=True, encoding='utf-8') return (cp_result1.stdout, cp_result2.stdout)