[Tutor] Request for help

Alan Gauld alan.gauld at yahoo.co.uk
Mon Aug 16 15:39:14 EDT 2021


On 16/08/2021 16:54, Mebale Tsige Araya wrote:

> Is there anybody who can help me, please? Can I run Python codes on
> Browser, please? If so could you have any idea how to run my codes on
> Browser?

Your question could mean several different things. I'll give
very brief answers to each below but you will need to give
more specific information for more specific answers.

1) Can I embed Python code in an HTML page and have the
browser execute it like JavaScript.

No. But you can get Python to JavaScript translators or languages that
look like Python (CoffeeScript) that are converted to JavaScript by the
server. There are at least 2 very old browsers that do run Python
internally but they are used by nobody in the realm world!

2) Is there a web site that lets me enter python code without Python
being installed on my  device?

Yes. There are a few sites that present a virtual terminal online that
lets you code python inside a browser. The code actually runs on the
server but the input and results appear in the browser. The caveat
is that they usually have limited support for modules and they don't
allow you to install third party add-ons beyond what the site owner
has installed (numpy may be there for example)

3) Can I write web site code in Python that will generate web pages that
can be seen in a browser?

Yes, there are many, many web frameworks for python from the super
sophisticated (eg Zope) to substantial but practical for humans (eg
Django) to simple ones for quick and dirty developments (eg Flask)
And you can use the cgi module in the standard library for very
basic web development.

If that's not enough or you meant something different then repost
with more details, perhaps even describing what you want to do
with it.

HTH
-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list