Skip to content

Commit

Permalink
Build: add Windows standalone build file and screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Nov 29, 2022
1 parent 3dcfae3 commit 8bfa93c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@

Learning project

![Screenshot on Ubuntu 22.04](./docs/screenshot/ubuntu22.png)

## Implemented features
- Left click (reveal cells), right click (mark cell), left+right click (validate cell)
- Configurable difficulty
- Restart popup with button at win/lose
- Display timer and remaining mines

## Build and Run
Run with Python environement:
- (powershell) `python mine.py`
- (linux) `python3 mine.py`
Linux
- Run with Python environement: `python3 mine.py`

Windows
- Run with Python environement (powershell): `python.exe mine.py`
- Build standalone executable for Windows using [py2exe](https://github.com/py2exe/py2exe) (powershell): `python.exe freeze.py`
- The result build is in `./dist`, double click `mine.exe` to run

## Development tools
- python3 on Linux / Windows
- gedit text editor

Binary file added docs/screenshot/ubuntu22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions freeze.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Build standalone executable for Windows

from py2exe import freeze

freeze(windows=['mine.py'],
options={'bundle_files': 1, # As we use only Python standard library
'compressed': True},
version_info={'copyright': "Yuxiao Mao",
'version': "1.0.0",
'product_name': "Minesweeper",
"product_version": "1.0.0"}
)

0 comments on commit 8bfa93c

Please sign in to comment.