TASK: Run two different Python scripts asynchronously at the same time. Script A: 'import time; time.sleep(5); print("Script A Done")'. Script B: 'import time; time.sleep(5); print("Script B Done")'. You MUST poll both until they are finished using process_get_status, then write their combined final outputs to 'parallel_results.txt'.
|
||
----------------------------------------
|
||
Loading...
|
||
|
||
[1;34m┌─── Python Source Code ─────────────────────────────────────[0m
|
||
[1;34m│[0m [2m 1 |[0m [34mimport[0m[33m time; time.sleep([36m5[0m[33m); print("Script A Done")[0m
|
||
[1;34m└────────────────────────────────────────────────────────────[0m
|
||
[1;34m┌─── Python Source Code ─────────────────────────────────────[0m
|
||
[1;34m│[0m [2m 1 |[0m [34mimport[0m[33m time; time.sleep([36m5[0m[33m); print("Script B Done")[0m
|
||
[1;34m└────────────────────────────────────────────────────────────[0m
|
||
[93520] Script A Done
|
||
[93522] Script B Done
|
||
-> Writing file: parallel_results.txt
|
||
|
||
[36m [2m CHANGES: parallel_results.txt [0m
|
||
LINE OLD | LINE NEW
|
||
--------------------------------------------------------------------------------------------------------------------------------------------
|
||
1 [31m-[0m [31mScript A Output: Script A Done [0m |
|
||
2 [31m-[0m [31mScript B Output: Script B Done [0m |
|
||
| 1 [32m+[0m [32mScript A Done [0m
|
||
| 2 [32m+[0m [32mScript B Done [0m
|
||
|
||
The two scripts have completed execution. The combined output has been saved to 'parallel_results.txt'.
|