HKDSE ICT Pre-SBA 2 Project
Version: 1.0.0
Class: 4E
Student ID: 13
Date: 27/02/2026
This Python program displays 7 different facial expressions using a 10x10 2D array system with nested loops for rendering. The project includes two versions:
4E13_preSBA2.py): Terminal-based with emoji rendering4E13_preSBA2_GUI.py): Mouse-clickable interface using tkinter with color customizationLatest Update: Fixed expression button highlighting - selected expressions now show clear visual feedback with blue background and sunken relief.
Smiling face
Frowning face
Furrowed brows
Wide eyes
Playful wink
Sunglasses
Heart eyes
Try the facial expression renderer right here in your browser!
Current: Happy | Scale: 1x
Each facial expression is stored as a 10x10 2D array template using placeholder symbols:
| Symbol | Meaning | Description |
|---|---|---|
F |
Face | Replaced with face color emoji |
E |
Eye/Mouth | Replaced with eye/mouth color emoji |
B |
Background | Replaced with background color emoji |
happy_face = [
["B", "B", "B", "F", "F", "F", "F", "B", "B", "B"],
["B", "F", "F", "F", "F", "F", "F", "F", "F", "B"],
["F", "F", "E", "E", "F", "F", "E", "E", "F", "F"],
["F", "F", "E", "E", "F", "F", "E", "E", "F", "F"],
["F", "F", "F", "F", "F", "F", "F", "F", "F", "F"],
["F", "E", "F", "F", "F", "F", "F", "F", "E", "F"],
["F", "F", "E", "F", "F", "F", "F", "E", "F", "F"],
["F", "F", "F", "E", "E", "E", "E", "F", "F", "F"],
["B", "F", "F", "F", "F", "F", "F", "F", "F", "B"],
["B", "B", "B", "F", "F", "F", "F", "B", "B", "B"]
]
# OUTER LOOP: Iterate through each row
for row_index in range(len(face_array)):
line = ""
# INNER LOOP: Iterate through each column
for col_index in range(len(face_array[row_index])):
symbol = face_array[row_index][col_index]
line += symbol
print(line) # Print the completed row
8 face colors, 6 eye colors, 3 background options
Normal (10x10), Large (20x20), Extra Large (30x30)
CLI terminal & GUI tkinter interfaces
Mouse-clickable GUI with real-time preview and visual button feedback
Run without Python installed
User-friendly menus and help system
python 4E13_preSBA2.py
python 4E13_preSBA2_GUI.py
Double-click dist/FacialExpression_4E13.exe
pip install pyinstaller
pyinstaller --onefile --windowed --name "FacialExpression_4E13" --clean 4E13_preSBA2_GUI.py
pip3 install pyinstaller
bash create_app.sh
| Category | Shortcut | Action |
|---|---|---|
| Expressions | 1-7 |
Select expression |
Numpad |
Also works | |
| Actions | Ctrl+R |
Refresh display |
Ctrl+C |
Copy to clipboard | |
Ctrl+D |
Reset defaults | |
F1 |
Show help | |
Ctrl+Q |
Quit program | |
| Scale | Ctrl+1 |
Normal (10x10) |
Ctrl+2 |
Large (20x20) | |
Ctrl+3 |
Extra Large (30x30) | |
| Colors | Shift+ââ |
Cycle face colors |
Shift+ââ |
Cycle eye colors |
sba stuff/
â
âââ 4E13_preSBA2.py # CLI version (terminal-based)
âââ 4E13_preSBA2_GUI.py # GUI version (tkinter windowed)
âââ create_exe.bat # Batch file for EXE (Windows)
âââ create_app.sh # Shell script for App (macOS/Linux)
âââ requirements.txt # Python dependencies
âââ LICENSE # MIT License
âââ README_4E13_preSBA2.md # Documentation
âââ FacialExpression_4E13.spec # PyInstaller spec file
â
âââ build/ # Build folder (after build)
â âââ FacialExpression_4E13/
â
âââ dist/ # Output folder (after build)
âââ FacialExpression_4E13.exe # Windows executable
âââ FacialExpression_4E13.app # macOS application