From 50ed657b0e690c0117e110dffc4cfef5f3f3f0b3 Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Sun, 27 Jun 2021 18:52:09 +0200 Subject: [PATCH] Allow running MultiMystery.py from source on linux --- MultiMystery.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/MultiMystery.py b/MultiMystery.py index aefc260a..84b78e0c 100644 --- a/MultiMystery.py +++ b/MultiMystery.py @@ -6,6 +6,7 @@ import concurrent.futures import argparse import logging import random +from shutil import which def feedback(text: str): @@ -76,8 +77,10 @@ if __name__ == "__main__": basemysterycommand = "ArchipelagoMystery.exe" # compiled windows elif os.path.exists("ArchipelagoMystery"): basemysterycommand = "./ArchipelagoMystery" # compiled linux + elif which('py'): + basemysterycommand = f"py -{py_version} Mystery.py" # source windows else: - basemysterycommand = f"py -{py_version} Mystery.py" # source + basemysterycommand = f"python3 Mystery.py" # source others weights_file_path = os.path.join(player_files_path, weights_file_path) if os.path.exists(weights_file_path): @@ -210,8 +213,10 @@ if __name__ == "__main__": baseservercommand = ["ArchipelagoServer.exe"] # compiled windows elif os.path.exists("ArchipelagoServer"): baseservercommand = ["./ArchipelagoServer"] # compiled linux + elif which('py'): + baseservercommand = ["py", f"-{py_version}", "MultiServer.py"] # source windows else: - baseservercommand = ["py", f"-{py_version}", "MultiServer.py"] # source + baseservercommand = ["python3", "MultiServer.py"] # source others # don't have a mac to test that. If you try to run compiled on mac, good luck. subprocess.call(baseservercommand + ["--multidata", os.path.join(output_path, multidataname)]) except: