aboutsummaryrefslogtreecommitdiff
path: root/launcher.py
blob: 47984297bb161ce0fea43e7a9a3325699ccc9693 (plain)
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
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")