21
loading...
This website collects cookies to deliver better user experience
A subprocess in Python is a task that a python script delegates to the Operative system (OS) - Daniel Diaz, GeekFlare
#calling the subprocess module into our environment
import subprocess
Process.start()
api from the multiprocessing
library offered by Python. #lets assume this data is updated every half minute
data = [3, 4, 7, 10, 2, 32, 15, 8]
from multiprocessing import Process
from file_location import data
def process_manager(data):
while True:
results = sum(data)
time.sleep(60)
return results
if __name__ == '__main__':
p = Process(target=process_manager(), args=(data))
p.start()
multiprocessing
and near real time data object into our code environment. We define a function to govern our process that we want to run every minute.