Python in the browser: Brython's recommendation

First, take a look at Brython's site. The clock is running, which is written in Python. Check in "View Source".

In other words, you can use Python instead of javascript. The work required to actually run it on your site is as follows. The location of the file is based on IIS as an example.

that's all. Let's try Brython!

hello.html


<html><head><script src="/brython.js"></script></head>
<body onload="brython()">
<script type="text/python">
def echo():
    alert("hello %s !" % doc["zone"].value)
</script>
<p>Your name is : <input id="zone"><button onclick="echo()">clic !</button>
</p></body></html>

hello.html

Recommended Posts

Python in the browser: Brython's recommendation
Display Python 3 in the browser with MAMP
Download the file in Python
Find the difference in Python
Getting the arXiv API in Python
Save the binary file in Python
Hit the Sesami API in Python
Get the desktop path in Python
Get the script path in Python
In the python command python points to python3.8
Implement the Singleton pattern in Python
Hit the web API in Python
I wrote the queue in Python
Calculate the previous month in Python
Examine the object's class in python
Get the desktop path in Python
Get the host name in Python
Access the Twitter API in Python
The first step in Python Matplotlib
I wrote the stack in Python
Master the weakref module in Python
Try running the basic information Python sample problem only in the browser
Learn the design pattern "Builder" in Python
Load the remote Python SDK in IntelliJ
Try using the Wunderlist API in Python
Check the behavior of destructor in Python
Learn the design pattern "Flyweight" in Python
Django ~ Let's display it in the browser ~
Try using the Kraken API in Python
Learn the design pattern "Observer" in Python
Learn the design pattern "Memento" in Python
Learn the design pattern "Proxy" in Python
Write the test in a python docstring
Learn the design pattern "Command" in Python
OR the List in Python (zip function)
Tweet using the Twitter API in Python
Learn the design pattern "Visitor" in Python
Learn the design pattern "Bridge" in Python
Check if the URL exists in Python
Learn the design pattern "Mediator" in Python
Associate the table set in python models.py
Learn the design pattern "Decorator" in Python
Run the Python interpreter in a script
The result of installing python in Anaconda
What is "mahjong" in the Python library? ??
Read the file line by line in Python
Read the file line by line in Python
MongoDB for the first time in Python
Learn the design pattern "Iterator" in Python
The basics of running NoxPlayer in Python
Learn the design pattern "Strategy" in Python
Learn the design pattern "Composite" in Python
Solve the maximum subarray problem in Python
Display pyopengl in a browser (python + eel)
In search of the fastest FizzBuzz in Python
[Python] Automatically operate the browser with Selenium
Learn the design pattern "State" in Python
Try hitting the YouTube API in Python
Get the EDINET code list in Python
Learn the design pattern "Adapter" in Python
The strongest Python development environment PyCharm's recommendation