Can you link a Python script to Android Studio? - android-studio

My aim is to create a recommendation app for Android which communicates with a script from a server to perform the Machine Learning parts and to generate recommendations for the current user. My original idea was to use Tensorflow but I am wondering if I could also write a Python script which can be called as a REST API? Would the data be best passed in JSON format?

You can create a Python Flask API and sent a POST Request to it. From that, you can use the data passed to run your ML parts on that data. However, you will need to find a way to run those ML parts after you pass your data to your Flask API. To get started, I would watch a youtube tutorial on how to make and use a Flask API. It is not terribly difficult to get up and started.

Related

Logging and Fetching Run Parameters in AzureML

I am able to log and fetch metrics to AzureML using Run.log, however, I need a way to also log run parameters, like Learning Rate, or Momentum. I can't seem to find anything in the AzureML Python SDK documentation to achieve this. However, if I use MLflow's mlflow.log_param, I am able to log parameters, and they even nicely show up on the AzureML Studio Dashboard (bottom right of the image):
Again, I am able to fetch this using MLflow's get_params() function, but I can't find a way to do this using just AzureML's Python SDK. Is there a way to do this directly using azureml?
The retrieving of log run parameters like Learning Rate, or Momentum is not possible with AzureML alone. Because it was tied with MLFlow and azureml-core. without those two involvements, we cannot retrieve the log run parameters.
pip install azureml-core mlflow azureml-mlflow
Need to install these three for getting run parameters. Link

automating testing website that require OTP, using Selenium, Node.js, Lambda(AWS)

My project is automating testing website using Selenium in AWS lambda(Node.js)
However, The testing website require mobile OTP(Google Authenticator) when users sign in.
I searched how to write code to automate sign in with OTP. but most of answers are using Python or java (pyotp or aerogear)...
We can't use another language and must use Lambda
Please help me!
You can run the python script in Lambda no problem there.
Write a python file, zip it, upload it to Lambda function.enter image description here
Just select the version(runtime) of python you want to use in configuration tab of the lambda function.

How do I create an endpoint in pyramid, and attach python code to it?

So I have built a application using hug, a python web framework. Now I am looking to move the system to pyramid, but pyramid is very confusing to me, even the tutorial. All that I really need for now is create endpoints (ie get: index.html, get: upload.html, post: upload) and attach python functions that I have already written to those endpoints
I have tried doing the pyramid tutorial, but even that seems confusing to me, and it seems like I am missing steps, or they were left out
Just to summarize, I am looking for a way to create a number of endpoints, both get and post, and attach python functions that I have already written to these endpoints

Is it Possible to take existing Python Script file and run it on the web

I am trying to take existing python code and run it as a web application. I am not entirely sure on how to do this, I was thinking about connecting the code to flask or django, but have no idea where to start.
Amrit, what you are asking is possible, but you should consider reading the documentations of both flask and django, aswell as doing some research to try to understand which would serve you better. You will learn a lot from chasing those answers on your own.
If you want to start with django: https://docs.djangoproject.com/en/2.2/intro/tutorial01/
If you want to start with flask:
http://flask.pocoo.org/docs/1.0/quickstart/

How to make a python application distributable

My question pertains to distributing a python application the proper way. i have done research, but the answers appear to be vague and usually instruct the user to upload projects to the python package index. I simply want to make sure i research the proper methods instead of steering in the wrong direction.
I have been writing a stock analysis application with stored text files, and a dozen or so python scripts that interact with each other. Outside computers are to communicate with my servers through a random port (not the internet ports). all the imports work properly and the communication works properly, but i have no clue how to approach the distribution/setup or the GUI.
As an application with dozens of python scripts, should i write each script as an executable via pyInstaller, or should i add a python environment to the application to install python on all the user systems?
I need to add 'README', and 'LICENSE' to the application. What is the point of set up? is that a resource so python knows what is going on or does it actually setup the application? Does it need a URL, and what is the point of using the URL? Do i need anything else for the setup tools?
How do i package the entire application to download on user systems? I want the software to be uploaded via a URL link or from a USB. Do i have to make a tar file? i can do it automatically by writing my own python setup script, but i believe python has an easier way. Do i put a function in the setup to send an executable file to the desktop as a controller so the users don't open all the folders? How do i install from a link on a website?
For a graphical interface for the users on python applications, do most programmers use tkinter, or python integration into HTML, CSS? I do not want this application to be live in a website, but rather as a desktop application. Do i need to use a framework, such as django, to implement python into my html code?
I apologize if this is all unorganized. Ive always coded my own programs and never distributed or put a GUI on any of the scripts, so i just want to make sure i approach the task the right way.

Resources