Update application_of_parallel_calculations_with_python.py

This commit is contained in:
guanjihuan 2022-02-06 20:33:59 +08:00
parent 50f44061be
commit e162cf0def

View File

@ -24,8 +24,8 @@ if __name__ == '__main__':
end_time = time.perf_counter() end_time = time.perf_counter()
print('运行时间=', (end_time-start_time), '\n') print('运行时间=', (end_time-start_time), '\n')
f = open('result.txt', 'w') f = open('result.txt', 'w')
for job_index in range(cpus): for task_index in range(cpus):
with open('task_index='+str(job_index)+'.txt', 'r') as f0: with open('task_index='+str(task_index)+'.txt', 'r') as f0:
text = f0.read() text = f0.read()
f.write(text) f.write(text)
f.close() f.close()