This repository contains the source code of the game engine behind Learn Programming: Python. The two key files are game.py (the main source of the game) and universal.py (a helper file).
If you have already purchased the game, you can simply drop these files into the game installation directory, and they should be able to load the lesson data just fine. To locate the game's installation directory, you can do the following:
- Open Steam
- Click on the "Learn Programming: Python" game in your Steam library
- Click on the gear button at the top-right of the page (directly under the game banner)
- Highlight the "Manage" menu, and click "Browse local files"
- The folder that Steam opens is the game's installation directory
- You can drop
game.pyanduniversal.pyin this folder, and then you can simply double-clickgame.pyto play!
- You can drop
Enjoy :-)
Running on Non-Windows OS
This open source game engine should work on any platform (not just Windows). To run it on non-Windows operating systems, you can do the following (instructions adapted from Knee Scabs; thank you!):
Step 1: Download Source to Steam Game Installation Directory
- Open Steam
- Click on the "Learn Programming: Python" game in your Steam library
- Click on the gear button at the top-right of the page (directly under the game banner)
- Highlight the "Manage" menu, and click "Browse local files"
- The folder that Steam opens is the game's installation directory
- Download
game.pyanduniversal.pyto the folder that was opened
Step 2: Editing the Source Code to Remove Windows Dependencies
- Comment out (
#) line 248 ofgame.py - On line 22 of
universal.py, replaceALT+ENTERwithF11 - Comment out (
#) lines 108-138 ofuniversal.pymsvcrtis a Windows-only module and is invoked by this in the start up
Step 3: Install prompt_toolkit
- If you have
pipinstalled, you would installprompt_toolkitfrom the command line like this:pip install prompt_toolkit - If you don't have
pipinstalled, you might be able to just download thisprompt_toolkitfolder and also add it to the game's installation directory (or, you can installpipand use the above command)
Step 4: Running the Game
You can run the game by calling python3 game.py when you're in the game installation directory (or add a shortcut of some sort).