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.
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.
Alan is not incorrect here (Python doesn't *natively* run in browser), but these days that's an increasingly meaningless distinction (even if we aren't there *yet*!). There are a couple of approaches to running Python in browser:
* Transpilation approaches like Brython: https://brython.info/static_tutorial/en/index.html * WASM approaches like Pyodide - https://pyodide.org/en/stable/
Pyodide is *newer*, and is used by JupyterLite to run JupyterLab in the browser without a backing server.
I won't add anything to Alan's other answers, as I think they fully cover it!
To pile on, if you are looking for help learning Python, there is another mailing list called firstname.lastname@example.org. They will be much more supportive with answering your questions. There is also a community on Reddit called r/learnpython that is very supportive. This mailing list is for proposing new features or changes to Python itself.