All guides

Online IDE for Python turtle, tkinter, pygame and Swing

A free online IDE that runs Python turtle, tkinter, pygame and Java Swing programs in their own windows, in the browser with nothing to install.

CS Room is a free online IDE for Python turtle, and for any program that opens a window. tkinter, pygame and Java Swing work too, in the browser, with nothing installed on the student's computer. It's a coding classroom as well, with classes, autograding and a gradebook.

Why GUI programs are hard to run online

A turtle or tkinter program needs a screen to draw on. Most online compilers only show text, so the program stops with a TclError about a missing display. A desktop install fixes that, but plenty of schools can't install software on student computers. Trinket, which drew turtle programs in the browser, has shut down.

How it works in CS Room

When a program opens a window, CS Room shows it in a pop-up. Students click and type in it like they would on a desktop, and the drawing updates as the program runs. The window closes when the program ends. Closing the window stops the program.

Turtle and tkinter work with Python 3.12 as soon as a student signs in. pygame needs one pip install pygame, and it stays installed in that student's workspace. Java Swing runs on Java 25. The same workspace also runs C, C++, JavaScript, TypeScript, C# and Go, and Jupyter notebooks.

Teaching with it

Turtle drawings are a good first week. tkinter fits a unit on events and interfaces, and pygame a games project.

The class side works the same as for any other assignment. Every student gets their own copy of your starter code. Text a program prints can be graded automatically. A drawing or a game you score by hand, with an override in the gradebook. Due dates collect everyone's work, and when a student is stuck you can open their workspace and edit alongside them.

Set up a class

  1. Request a teacher account. We set teachers up within a day or two.
  2. Create a class and share its class link. Students sign in and click Join class.
  3. Students open a .py or .java file and click Run. The program's window opens in a pop-up.
  4. End each turtle program with turtle.done(), or the window closes as soon as the drawing finishes.

To autograde printed output, see Writing assignment tests.

Before you start

If the browser blocks the window, allow pop-ups for csroom.org. There's no GPU, so 3D and OpenGL programs render slowly in software.

Request a free teacher account to start a class.