Running python in my browser

Hi

As well as I open PHP scripts on my browser without to have PHP installed in my computer I want to open scripts written in Pyton in my browser (from my hosting page not localhost) without installing one in my computer. It is possible?

The file extension works with '.py" in my browser?

Thank you in advance
lebron letchevAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

aikimarkCommented:
Do you want it to run in the browser or just show you the results of running in your browser?
lebron letchevAuthor Commented:
Do you want it to run in the browser.

For example:

www.mywebsite.com/firstscript.py
aikimarkCommented:
What does that link have to do with my question?
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

lebron letchevAuthor Commented:
I want open a file written in Python on the address bar like the other server side programs. It is just to illustrate  I want to run in the browser
David Johnson, CD, MVPOwnerCommented:
when you browse to a .aspx page or a .php or .py the code does not execute in your browser but on the web server and the web server then sends html to your browser.
lebron letchevAuthor Commented:
Regarding PHP, I did not have mysql nor phpmyadmin, for example, installed on my computer, but where I host my pages there is support for PHP and in this way I have created my scripts in .php.  I gave up learning ASP.NET, I already tested dozens of scripts and none works, although lfchosting.com runs asp.NET, it seems I need a config file. Now I am motivated to learn Python. For my surprise it runs on DOS orif you prefer on the root of the disk.

I like to use PHP for AI development, but I read that Python, C#, Javascript and Prolog are the best Programming Languages for Artificial Intelligence field NOT PHP. I know Prolog for DOS, indeed it is the better langauge for AI, but DOS is dead or not????
Dave BaldwinFixer of ProblemsCommented:
The only 'language' that browsers run anymore is JavaScript.  Languages like PHP, Python, and Perl run on the server and send the HTML results to the browser.  You can use any language to generate an HTML page that a browser can display.  While a web server is normally used to host the pages that are generated, a local file can also generate content that can be displayed in a web browser.

AI (Artificial Intelligence) programs do not run in the browser.  They will run on a host computer or server.  They can generate content for a web browser but it is just as likely that they will generate displays for the desktop of the computer they are running one.
peprCommented:
As others wrote, you probably want to search for a web site that will allow you to run Python scripts. But you cannot run Python script whan being off-line. It always runs on the remote server.

You can try https://trinket.io/ -- but this is just an example that I have found just now.
lebron letchevAuthor Commented:
Thank you

It looks like I would need to install Django + Python (for windows) and in this way I could build an application for the Internet, at least on my computer using localhost.
peprCommented:
Django is for building web applications. If you are a beginner, it may be quite complex for you. It is a good framework but rather big one. If you really want to build a web application, you may consider first to research also some alternatives that may be easier. If you want to build a bigger site (for future), Django may be good for you.
lebron letchevAuthor Commented:
You are right. A quite complex to me. I build web applications directly online through my web hosting using Filezilla as FTP. But never I did something like this.

in JSP and C # would happen like this?

I am One Flew Over the Cuckoo's Nest indeed.
peprCommented:
Actually, you probably can "build web application" through FTP only when your provider provides you a server that works files like PHP. They actually run a web server done exactly for that.

For C#, the provider has to support another kind of a web server (probably ASP.NET). Another difference is that you have to compile your web application, and you copy the binaries (kind of) to the web site. They are likely to be commercial servers (not free), because they are Microsoft-solution based. And it also means you usually have to pay (at least a part) of the commercial license.

Similarly, you may find some provider that supports Django or other Python web frameworks.

I do not have first-hand experience with JSP, but I guess it will be similar to C# case.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lebron letchevAuthor Commented:
Thank you
lebron letchevAuthor Commented:
Thank you
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Python

From novice to tech pro — start learning today.