-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathscripts.py
More file actions
32 lines (23 loc) · 880 Bytes
/
scripts.py
File metadata and controls
32 lines (23 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import platform
import shutil
import sys
def check_system():
_python_command = "python" if platform.system() == "Windows" else "python3"
if int(platform.python_version_tuple()[1]) < 10:
print("Please use Python 3.10+")
sys.exit()
if not shutil.which("poetry"):
print("Poetry not found, please install poetry by running this commands:")
print(f"curl -sSL https://install.python-poetry.org | {_python_command} -")
print(
r"set PATH=%PATH%;%USERPROFILE%\AppData\Roaming\pypoetry\venv\Scripts"
if _python_command == "python"
else 'export PATH="$HOME/.local/bin:$PATH'
)
def run_game():
print("Loading the game, please be patient...", flush=True)
# pylint: disable=import-outside-toplevel
from game import main
main()
if __name__ == "__main__":
check_system()