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.py
anduniversal.py
in this folder, and then you can simply double-clickgame.py
to 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.py
anduniversal.py
to 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+ENTER
withF11
- Comment out (
#
) lines 108-138 ofuniversal.py
msvcrt
is a Windows-only module and is invoked by this in the start up
prompt_toolkit
Step 3: Install - If you have
pip
installed, you would installprompt_toolkit
from the command line like this:pip install prompt_toolkit
- If you don't have
pip
installed, you might be able to just download thisprompt_toolkit
folder and also add it to the game's installation directory (or, you can installpip
and 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).