diff options
Diffstat (limited to 'launcher.py')
-rw-r--r-- | launcher.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/launcher.py b/launcher.py new file mode 100644 index 0000000..4798429 --- /dev/null +++ b/launcher.py @@ -0,0 +1,25 @@ +import os +from subprocess import * +import threading + +def execute_source_file(file_name): + ext = file_name.split('.') + if ext[1] == 'py': cmd = 'Python' + elif ext[1] == 'r': cmd = 'RScript' + run( + f'{cmd} {file_name}', + cwd = os.getcwd(), + start_new_session = True + ) + +src_fil_py = threading.Thread(target=execute_source_file, args=['source_file.py']) +src_fil_r = threading.Thread(target=execute_source_file, args=['source_file.r']) + +src_fil_r.start() +src_fil_py.start() + +src_fil_r.join() +src_fil_py.join() + +print("end launcher") + |