from pyboard import Pyboard pyb = Pyboard('COM22', 115200) pyb.enter_raw_repl() ret = pyb.exec('print(1+1)') print(ret) pyb.exit_raw_repl()