How To Use React With Python!

Manpreet Singh
2 min readJun 8, 2023

Welcome back! Python is one of the best programming languages out there, but, what if there was a way to use the React framework with Python? Well, now there is a way to do this! This is by using the ReactPy Python package! Here is a link to their GitHub page if you want to learn more about it:

This specific package allows us to use several different backends to build out our projects! Some of the built in ones are Flask, FastAPI, Sonic, and even Tornado! If this sounds awesome, you can install this project by using the following pip command:

pip install reactpy

Once installed you are ready to go! From their GitHub page, you can use their basic “Hello World” example of getting started:

from reactpy import component, html, run

@component
def hello_world():
return html.h1("Hello, World!")

run(hello_world)

You can also check out a working concept of this package within the following Jupyter Notebook (from their website):

--

--