-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53742bf
commit 20d82cc
Showing
5 changed files
with
136 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Fortune Wheel | ||
|
||
Fortune Wheel is a Python application that simulates a spinning wheel of fortune. Users can spin the wheel and win random prizes defined in a JSON configuration file. | ||
|
||
## Features | ||
|
||
- Visualization of a fortune wheel with customizable prizes. | ||
- Buttons to spin the wheel and stop it on a random prize. | ||
- Simple prize configuration via a `fortuneWheel.json` file. | ||
|
||
## Requirements | ||
|
||
- Python 3.x | ||
- The following Python libraries must be installed: | ||
- `tkinter` (included in standard Python) | ||
- `matplotlib` | ||
- `numpy` | ||
|
||
## Configuration | ||
|
||
The `fortuneWheel.json` file contains the items for the wheel. You can modify it to add or remove prizes. Here’s an example of how the file should look: | ||
|
||
```json | ||
{ | ||
"title": "Ruota della fortuna", | ||
"description": "Gira la ruota e scopri la prossima attività!", | ||
"btnSpinText": "Gira la ruota", | ||
"btnStopText": "Ferma la ruota", | ||
"items": [ | ||
"Prize 1", | ||
"Prize 2", | ||
"Prize 3", | ||
"Prize 4", | ||
"Prize 5", | ||
"Prize 6", | ||
"Prize 7", | ||
"Prize 8" | ||
] | ||
} | ||
``` | ||
|
||
## Running the Application | ||
To run the application, make sure to have the `fortuneWheel.json` file in the same directory as the executable. You can start the app with the following command: | ||
|
||
```bash | ||
python fortuneWheel.py | ||
``` | ||
|
||
### Creating the Executable | ||
You can generate an executable using `pyinstaller`. Make sure you have `pyinstaller` installed: | ||
|
||
```bash | ||
pip install pyinstaller | ||
``` | ||
|
||
Then, run the command: | ||
|
||
```bash | ||
pyinstaller --clean fortuneWheel.spec | ||
``` |
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# -*- mode: python ; coding: utf-8 -*- | ||
|
||
|
||
a = Analysis( | ||
['fortuneWheel.py'], | ||
pathex=[], | ||
binaries=[], | ||
datas=[], | ||
hiddenimports=[], | ||
hookspath=[], | ||
hooksconfig={}, | ||
runtime_hooks=[], | ||
excludes=[], | ||
noarchive=False, | ||
optimize=0, | ||
) | ||
pyz = PYZ(a.pure) | ||
|
||
exe = EXE( | ||
pyz, | ||
a.scripts, | ||
a.binaries, | ||
a.datas, | ||
[], | ||
name='fortuneWheel', | ||
debug=False, | ||
bootloader_ignore_signals=False, | ||
strip=False, | ||
upx=False, # Disabilita UPX | ||
upx_exclude=[], | ||
runtime_tmpdir=None, | ||
console=False, | ||
disable_windowed_traceback=False, | ||
argv_emulation=False, | ||
target_arch=None, | ||
codesign_identity=None, | ||
entitlements_file=None, | ||
icon=['assets\\icon.ico'], | ||
) | ||
|
||
|
||
import shutil | ||
shutil.copyfile('fortuneWheel.json', '{0}/fortuneWheel.json'.format(DISTPATH)) |