Kingdom.py
Run an island town by writing the Python scripts your heroes and townsfolk follow
Kingdom.py is a town builder where you never click to build. You start on a small island with one hero, a town hall and a file called main.py, write calls such as build(House, 3, 4), and press Run. The hero carries out your script line by line while the editor highlights the running line, and errors are explained in plain words.
Paid · No login · Desktop · Beginner

About Kingdom.py
The economy is made of small programs: collecting taxes, cutting wood, sowing and harvesting, baking bread, guarding against bandits and loading ships to trade with six islands. The story chapters introduce variables, while loops, if, for, lists and dicts, functions and modules, and later have several heroes running separate programs that share a database. Townsfolk move in too, and you can script them as well.
A paid game for Windows and Linux on Steam. No account is needed beyond Steam.
Questions about Kingdom.py
I have never written Python. Can I still get through it?
- Yes. The Steam page says the story is written for people who have never coded. It includes a Code School, hints and a reference solution for every chapter, so you are not left alone with a failing script.
How long does the story take?
- The page says a newcomer needs about eight hours to get through the story. Someone who already writes Python will likely be quicker, though the page gives no figure for that.
Can my scripts use real Python libraries?
- Later chapters bring in modules, and the page names numpy, pandas, matplotlib and requests. In the game world the web requests are carried by pigeons. Chapters before that cover variables, loops, if, lists and dicts, and functions.
Is there a Mac version?
- As of November 2026, the Steam page lists macOS 12 as the minimum and calls the Mac version an early test build. Windows and Linux or SteamOS are listed as well.
Made this game? Claim it →

Tips and discussion
No tips yet.
Sign in to share a tip.