The classic word game, implemented in Python.
The current version selects words from a chosen subject.
Your goal is to guess the mystery word chosen by the computer opponent.
- Enter your name when prompted.
- Select a category when prompted.
- The computer will think of a secret word and tell you how many letters are in the word.
- Make guesses one letter at a time to guess the secret word.
- If you think that you know the word, you may guess the entire word.
- Each time you guess a letter, all occurrences of that letter in the word will be shown.
- If your guess is incorrect, a part of the hangman figure will be drawn.
- Continue guessing letters to reveal the entire word.
- You may quit at any time by pressing "Ctrl + C".
Winning and Losing:
- If you correctly guess the word before the full hangman figure is drawn, you win.
- If the full hangman figure is drawn before you guess the word, you lose.
Hangman-CLI requires Python version 3.9 or later. This is usually available by default in Linux. For other operating systems, Python may be downloaded from: Python.org.
Latest release (all files): Hangman-CLI Releases.
Each release includes:
- hangman.py: The Python application.
- ascii_art.py: The game's ascii artwork.
- lexicon.py: The game's wordlists.
- hangman_installer.run: An installer for Linux only.
- Source code (zip): The source code (ZIP archive).
- Source code (tar.gz): The source code (tarball),
The installer app has been tested on Ubuntu and Debian.If you have any difficulty with it on your system, please post an issue HERE
-
Download the file: hangman_installer.run
-
Set the file permissions to executable.
-
GUI method:
- Right click on file > Properties
- in the 'Permissions' tab, enable "Allow this file to run as a program."
-
Command line method:
chmod +x hangman_installer.run
-
-
Double-click on the installer to install the game.
The installer will extract the following files:
- hangman-cli -> ~/.local/bin/Hangman-CLI/hangman-cli
- ascii_art.py -> ~/.local/bin/Hangman-CLI/ascii_art.py
- lexicon.py -> ~/.local/bin/Hangman-CLI/lexicon.py
- hangman-cli.ico ->
~/.local/share/icons/hangman-cli.ico
- hangman-cli.desktop ->
~/.local/share/applications/hangman-cli.desktop
The hangman-cli.desktop
file should be detected automatically by the
Desktop menu and create a launcher in the Games
section.
After installation, the game may be launched, either from your Applications menu
or by entering the command hangman-cli
in a Terminal window.
Uninstalling To uninstall hangman, run the installer in a terminal window:
bash hangman_installer.run -- --clean
If you don't have Linux, or prefer to play the game without installing, Hangman-CLI is also available as a ZIP package.
Preferred Method:
- Download the file: hangman.py
- Extract the contents of the ZIP file somewhere convenient.
- Double-click on the hangman.py file.
Alternate Method:
- Download the file: hangman.py
- Extract the contents of the ZIP file somewhere convenient.
- Open Command Prompt by typing "cmd" in the Start menu.
- Use
cd path\to\hangman.py
to navigate to the folder containinghangman.py
- Launch the game with the command:
py hangman.py
- Download the file: hangman.py
- Extract the contents of the ZIP file somewhere convenient.
- Drag the
hangman.py
file to PythonLauncher.
- Download the file: hangman.py
- Extract the contents of the ZIP file somewhere convenient.
- Open a Terminal window from the Applicatins menu, or "Ctrl + Alt + T".
- Use
cd path/to/hangman.py
to navigate to the folder containinghangman.py
- Launch the game with the command:
python3 hangman.py
This program is released under the MIT license.
Please report any issues HERE.
The installer for this game was created using makeself.