Python app run using browser - python

I would like to run my python application locally in any web browser. I am using PyCharm IDE for my Python apps but when i run app from IDE, its not running in browser. How it can solve?
Thanks.

you should run your code using server. there are many available. for example:
a link
your code will be triggered through demo_app in example from link above.

Related

Why is my python script not running in shared hosting cpanel GoDaddy

I have shared hosting for my website at Godaddy with shared hosting in cpanel. I made a python script that print hello and I even tried with the GUI too but it is not printing. It is only showing the code. I called GoDaddy and they said to do print("Hello World") but even though I did it is still not working. Right now my code is print("Hello World"). Printing hello world like that normally works but it is not working. I need to use python 2.6.6 because that's what GoDaddy gives as the version number for python. Please can somebody help?
You can check out my python script in my website at My python script in my website.
You use Apache Web server, and it doesn't process you python script. It consider it as static file and return it's content.
There are a few ways to make it work
mod_python for your Apache server
Use CGI
Make apach proxy to python web server by your choice (e.g. gunicorn)
I found out that python is installed on it but it doesn't let you run python scripts in godaddy economy hosting cpanel. Thanks!

Execute PhantomJS on a Flask Web App on IIS

I developed a python web app in flask and I'm trying to deploy it correctly on IIS.
Before i launch the app to production server I'm testing it on a VM.
All the steps i did:
Install IIS with CGI
With IIS installed, I download the web platform installer
I installed the WFastCGI for Python 3 (my version)
I configured the Handler Mappings and the CGI Settings to deploy my app, and is all fine.
The Website is all working, except one part. One of the functions of the website require execute a webdriver, in this case PhantomJS, with selenium python module.
The PhantomJS executable is on the root folder of the website:
PhantomJSPath = 'phantomjs/bin/phantomjs.exe'
But when i try to use declare the variable to select the webdriver his just don't run on IIS (when i open that specific page of that function it gives me a 500 ERROR, all the other pages work perfectly). The stupid thing is, when i execute by Flask development mode on port 5000 it just works perfectly.
browser = webdriver.PhantomJS(PhantomJSPath)
I tried a lot of stuff already like give all permissions to everyone on the web app folder and stuff like that. I think the problem is with IIS configuration or security settings.
I hope you can help me and all of the other people with the same issue ;) TY
Ok, i solved it. just configured the Website settings on IIS and Application pool to the specific path of the website, give all the permissions to the IIS user (IIS_USRS) and it works. Ty anyway!.
If you know any other ways to fix this issue just post. I Will mark if it works too.

How to shell into a locally running Python app?

new to GoogleAppEngine, this question may sound stupid... I just followed the tutorial and created a Python app, which is running locally with GoogleAppEngineLauncher. Is there any way to shell into the Python shell and play with the data structures in the running app? Thanks!
For locally running apps you can use the Interactive Console that is included in the Development Console.
The Interactive Console allows developers to enter arbitrary Python code into a web form and execute it inside their app's environment.
Navigate to the Development Console, click the Interactive Console link on the left pane. A form with a single text area will display. Enter any arbitrary Python code you like in the text area, then submit the form to execute it.
You can find more details in App Engine Python Developement Server documentation.
Google App Engine Remote API for Python: Using the Remote API Shell
This might be what you're looking for?

Execute python script in localhost

I have downloaded and installed python on my PC. I am learning python at this moment so I am a beginner.
Is there anyway I could execute python scripts in localhost (Apache) and view them in a web browser as we do with PHP? I am executing the python scripts from CLI at this moment.
Although there are multiple solutions, I would take a look at mod_python. Unfortunately, in my experience it is not the easiest thing in the world to set up and requires making changes to httpd.conf, but this tutorial is helpful (and gives some examples).
Google App Engine SDK for Python includes a local web server application that simulates the App Engine environment. It allows for instant server script changes by just saving the file and refreshing the browser.
The development tutorial is here
Once you have your web site working locally, it is easy to deploy it live on Google's App Engine servers.

Problem with running Django 1.1.1 on Google App Engine Developement Server

I've downloaded google_appengine version 1.3.1. Using some web tutorials, I've created basic django 1.1.1 application. Using appcfg I managed to deploy it on GAE and it works. The problem is, that application doesn't want to work on dev_appengine.py developement server.
Whenever I run the app GAE local server is returning HTTP 200 without any content. If I set basic environement and run main.py manually, then the page is properly returned on stdout.
I've also created very basic helloworld application, and this one is working ok on the devel server.
Do you have any idea, how can I debug the devel server? Option -d doesn't give any usefull insight at all.
I had module nammed same way as the default GAE launcher (main/ and main.py). After renaming the launcher everything works great.

Categories