diff --git a/start.py b/start.py index 6b39046..b592e5b 100644 --- a/start.py +++ b/start.py @@ -14,5 +14,19 @@ # @link http://www.PieMC-Dev.github.io/ import subprocess +def check_python_version(): + try: + # Attempt to run the 'python' command and check if it's available + subprocess.check_output('python --version', shell=True) + return 'python' + except subprocess.CalledProcessError: + try: + # Attempt to run the 'python3' command and check if it's available + subprocess.check_output('python3 --version', shell=True) + return 'python3' + except subprocess.CalledProcessError: + raise Exception("Neither 'python' nor 'python3' found in your system.") +selected_python_command = check_python_version() +print(f"launching with the command: {selected_python_command}") subprocess.call(['python', '-m', 'piemc'])