So I have been working abit with multiprocessing and finally got it to work with multiprocessing - Basically now I got it to run so every tasks runs now depending on how many tasks I enter.
def main():
user_input = 0
while True:
try:
user_input = int(input(Fore.WHITE + 'How many tasks do you wanna run? [NUMBERS] \n' + Fore.RESET))
except ValueError:
print(Fore.RED + "Stop being stupid" + Fore.RESET)
continue
else:
HowManyThread = user_input
print()
i = 0
jobs = []
for i in range(HowManyThread):
p = multiprocessing.Process(target=info, args=(str(i),))
jobs.append(p)
time.sleep(.5)
p.start()
for p in jobs:
p.join()
sys.exit()
however I was looking through other stackoverflow threads and found
with open(fname) as f:
content = f.readlines()
# you may also want to remove whitespace characters like `\n` at the end of each line
content = [x.strip() for x in content]
where I have all my names in fname etc:
Barry Alex Sven Mila Jenny etc etc...
However what the multiprocessing is doing though is that it actually reads the same for each tasks and I can't really get a grip what to do now...
Basically what I want to do is that etc...
tasks 1 to read first line tasks 2 to read second line tasks 3 to read third line etc etc...
What could be the best solution for this?