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 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

That’s exactly what I needed, thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.