Link to home
Start Free TrialLog in
Avatar of lebron letchev
lebron letchev

asked on

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
Avatar of aikimark
aikimark
Flag of United States of America image

Do you want it to run in the browser or just show you the results of running in your browser?
Avatar of lebron letchev
lebron letchev

ASKER

Do you want it to run in the browser.

For example:

www.mywebsite.com/firstscript.py
What does that link have to do with my question?
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
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.
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????
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.
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.
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.
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.
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.
ASKER CERTIFIED SOLUTION
Avatar of pepr
pepr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you
Thank you