[執行緒] 使用批次檔來完成並行程序的簡單方法

@REM DOS BATCH
@ECHO OFF
PYTHON "test1.py"
START PYTHON "test2.py"
PYTHON "test3.py"


#! python3
# -*- coding: UTF-8 -*-
#test1.py
import time

print('[test1]')
for i in range(10):
    print('test1...' + str(i))
    time.sleep(1)


#! python3
# -*- coding: UTF-8 -*-
#test2.py
import time

print('[test2]')
for i in range(100):
    print('test2...' + str(i))
    time.sleep(1)


#! python3
# -*- coding: UTF-8 -*-
#test3.py
import time

print('[test3]')
for i in range(100):
    print('test1...' + str(i))
    time.sleep(1)

留言

這個網誌中的熱門文章

[環境設定] 應用程式執行別名

[變數] 使用全域變數