I am making an app which will login to a website and scrape the website for the information I have. I currently have the all the login and web scraping written in Python completely done. What I am trying to figure out is running that python code in Xcode in my swift project. I want to avoid setting up a server capable of executing cgi scripts. Essentially the user will input their credentials and I will pass that to the python file, and the script will run.
Short answer: You don't.
There is no Python interpreter running on iOS, and Apple will likely neither provide nor allow one, since they don't allow you to deliver and run new code to in iOS app once it's installed. The code is supposed to be fixed at install time, and Python is an interpreted language.
Related
I want to write a program using python as logic, because of the extensive libraries available in python suited for this project, and to develop the UI using react.
Is this at all possible, or is there a different method which is easier?
if you want to use react as a front end for a website, you could run python as the back end using something like flask or Django. Python can't be run in the browser, you'll need to run python on a server or run in locally on your machine if the project is just for you.
As a training project i have made activity tracker using python (no GUI, only command-line).
Script checks with win32gui/pywin32 and pyautogui what program is currently used, and if it is web browser what web site is in use.
Name of window, date, and amount of time spent on program/website is stored in sqlite3 database.
Then with help of pandas module same names are grouped and time is summed up.
I want to convert this script into web app using django but i am beginner in creating web apps, so i am wondering: is it possible to use this modules within django and is it even possible to create web app that works same as script mentioned earlier?
Sorry if the question is trivial. I will be grateful for every tip where and what exactly to look for in this topic.
Nope.
You can't make a server to connect through a web client/browser and see the other processes. That's a security issue, a big one.
Btw, some GNU/Linux desktop environments won't even allow the same user's processes in the same logged-in session on the same computer to see each other (Wayland).
I have been getting into programming and I would love it if my friends and I could program python (Client Side as in I could run it on my computer offline(Saying it is an offline application)) in cloud 9 IDE (If you don't know you can work real time with your team in the IDE). The problem is it will run it as if I am using it as a web language. Also DJANGO just gets in the way.
Any way I can launch it as an application?
You need not install Django on Cloud9. You've got the option to install a blank container. From there you can pip install anything like. Write your .py file and then python run myfile.py -- Link to Cloud9 Docs
While not as slick as Cloud9 Python Anywhere which is more focussed on Python Apps.
I have a website with miniwebhost.com, which supports python. I want to have a page that runs one of my text based games I have made on Python. So, how would I go about doing it? I know I have to make it executable and something about a cgi-bin(which I have). Put your answer in clear steps please.
Site is: www.rosshudson.co.uk/
Python web applications are often hooked to the web server (e.g. Apache httpd) using the WSGI module. Note that your app need to handle the HTTP requests correctly either by using a framework (like Django) or the BaseHttpServer, BaseHttpRequestHandler from the standard library.
I am creating a Python application that uses multiple third party libraries. Since the libraries are installed on my computer, the script runs fine. However, how can I alter my script so that it will run on any computer (all major OS), even if the computer does not have the third party Python libraries installed?
By your comment:
I want the script to stay a python script if at all possible so that
it can be run on any device and run through a webpage
It appears you want some way to host a python program online.
To do this, you need:
To know how to write Python that serves a website (see Django, Flask, CherryPy, etc...)
Some way to deploy said application to the web. An easy, free (<-- this is the keyword) way to deploy Python web apps is through using Heroku or some other free hosting site. Or you could always pay for hosting or host it yourself.