Hello I am trying to run a script multiple times but would like this to take place at the same time from what I understood i was to use subprocess and threading together howev
Personally, I'd use multiprocessing. I'd write a function that takes a filename and does whatever the main guts of execution does (probably by importing execution and running some function within it):
import multiprocessing
import execution
import datetime
#assume we have a function:
#exection.run_main_with_args(filename,name,today_str,dbfolder)
today = datetime.datetime.today()
def my_execute(filename):
if '.htm' in filename:
name = filename.strip('.htm')
dbfolder = "C:/newscript/db/" + name
os.makedirs(dbfolder)
execution.run_main_with_args(filename,name,str(today),dbfolder)
p = multiprocessing.Pool()
p.map(my_execute,list_of_files_to_process)