Files
2025-03-18 11:13:31 +08:00

28 lines
602 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import conf
import subprocess
scheme = conf.scheme
def run_script(script_name):
try:
subprocess.run(['python', script_name], check=True)
print(f"{script_name} success")
except subprocess.CalledProcessError as e:
print(f'Run {script_name} error: {e}')
except FileNotFoundError:
print(f'Can not found: {script_name}')
if __name__ == '__main__':
if scheme == 'A':
run_script("schemeA.py")
elif scheme == 'B':
run_script("schemeB.py")
else:
print('Please check the scheme field in the configuration file conf.py')