Instructions

Follow these steps in order. Each one takes a few minutes.

Step 1: Install Python

  1. Open python.org/downloads and download the Windows installer.
  2. Run it. Choose Customize installation.
  3. Tick tcl/tk and IDLE (needed for windows and games).
  4. On the next screen, choose Install for me only.
  5. Finish the installation, then close any open Command Prompt windows.

Step 2: Download and extract SaiLang

  1. Download SaiLang {{VERSION}} and optionally check it with the checksum tool.
  2. Right-click the ZIP and choose Extract All. Put the folder somewhere permanent, such as Documents\SaiLang.

Step 3: Open SaiLang IDLE

Open the extracted folder and double-click SaiLang-IDLE.pyw. The SaiLang editor opens.

To make .sai files open in IDLE: right-click a .sai file, choose Open with > Choose another app, select Python (or pythonw.exe in your Python folder), tick Always use this app, and click OK.

Step 4: Write your first program

  1. In IDLE choose File > New.
  2. Type:
    make name = ask("What is your name? ")
    say "Hello,", name
  3. Choose File > Save As and save it as hello.sai.
  4. Press F5, type your name in the Program input box, and press Enter.

Alternative: the Command Prompt

Open Command Prompt in the SaiLang folder and run:

set PYTHONPATH=src
python -m sailang examples\hello.sai
python -m sailang                  (starts the prompt)
python -m sailang check hello.sai  (checks without running)

The set line lasts for one Command Prompt window, so run it again in each new window.

Windows and games

The examples desktop_app.sai, image_viewer.sai and coin_collector_game.sai open windows. Run them with F5 in IDLE. Closing the window ends the program.

Troubleshooting

"Python was not found" or Windows opens the Microsoft Store
Install Python from python.org as in Step 1. Then turn off the python "App execution alias" in Settings > Apps > Advanced app settings > App execution aliases.
Windows or games do not open, and an error mentions Tkinter
Run the Python installer again, choose Modify, and tick tcl/tk and IDLE.
Double-clicking a .sai file does nothing
Follow the "Open with" steps in Step 3 once. Windows does not know which program to use for .sai files until you choose.
Smart App Control blocks a file
Use SaiLang-IDLE.pyw or the Command Prompt method. Both run through Python, which Windows allows. Do not try to unblock .bat files.
A file was saved as hello.sai.txt
In Save As, set "Save as type" to All Files, or rename the file and remove the .txt.
An error names a line number
The message shows the file and line. In IDLE that line is highlighted in red. Read the message: it says what SaiLang expected.
Text shows strange characters
Save the file as UTF-8 (the IDLE save button does this for you).