Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way I can run a python Script when a button programmed in flutter is pressed?

Essentially , what I want to do is , press a button that I program in Flutter and when that button is pressed , a python script should start running on my Android device .

I want to use youtube-dl (used to download Youtube videos) library in python but I wanna know if there is a way to run the library in flutter .

Any Help is appreciated . Thanks in advance .

like image 200
Ankit Chawla Avatar asked Jan 11 '20 19:01

Ankit Chawla


People also ask

Can I combine flutter and Python?

Learn how to build State-of-the-Art algorithms in Python and then implement them into a Flutter application! Build any Neural Networks in Python and then export them into your Flutter application. Have a clear understanding of different types of Neural Networks and how you can use them to your advantage.

Can we use Python instead of dart in flutter?

You can use that package to integrate python scripts into your flutter app. Also an advantage of it, is that it supports pip packages natively. @AnbuselvanRocky unfortunately no.


2 Answers

I think you should create a flask API in python and deploy it in the Heroku platform. After getting the endpoint of that API you can request that API in flutter easily.

like image 86
parth panchal Avatar answered Sep 29 '22 19:09

parth panchal


I know it's quite old now but may be someone else can get help out of it. There is library called starflut and it can incorporate python code inside your flutter app. Take a look here

https://pub.dev/packages/starflut

like image 29
Hasandroid Avatar answered Sep 29 '22 18:09

Hasandroid