Python web editor

  1. Overview
  2. How it was built

Overview

I created a web app that allows you to write and run Python code in the browser.

Try it out!

Image of web editor

The app consists of three resizable text areas. The first is for writing Python code, the second is the program's input, and the last is for the program's output. The input and output areas both have a button to clear their contents.

When the code is executed the input text is passed in as stdin. There are a couple of ways to read stdin in Python, and this is often how you would get user input in a commandline Python program. I have also used stdin for reading inputs when completing programming challenges on sites like Advent of Code.

I hope people find it useful for writing small Python programs, and running Python code in the browser on devices where installing Python is not possible.

How it was built

Expanding on the work from my Python Course, This editor uses Pyodide to execute Python code in the browser.

I have a tutorial on how to use Pyodide here.

The editor is also built with React, Tailwind CSS, Heroicons, and the Monaco Editor which is a major part of VSCode.