2

I am working on an automation app for Raspberry that requires a few python scripts to work. I made the front end in flutter. Is it possible to run these python scripts through a flutter app running on Raspberry Pi when a button in that app is pressed? (for example turning a stepper motor, sending current through a GPIO pin for a few seconds) It should work offline, and I would prefer if these scripts were saved as an external .py file.

To run the app on raspberry, I was planning on using https://github.com/ardera/flutter-pi If there is a better variant to do that, please tell me so.

1 Answers1

3

With process_run package you can call scripts like in the command line. From the way I understand your problem you could prepare the required python scripts, store them and call them with process_run whenever you need them.

This is roughly equivalent to the python module called subprocess.

rot8
  • 143
  • 2
  • 10