flutter 에서 python 스크립트 실행

macos 권한 문제가 있었다.

void goPython() async {
    final scriptPath = "${Directory.current.path}/hello.py";
    var processResult = await Process.run('python3', [
      scriptPath,
    ]);
    setState(() {
      result = processResult.stdout;
      answer = processResult.stderr;
    });
}

Last updated

Was this helpful?