1
這是我的Python代碼:PHP和Python
import threading
import time
import MySQLdb
import sys
conn=MySQLdb.connect (host = "localhost",
user = "root",
passwd = "",
db = "profiles_sheduleit")
cur = conn.cursor()
def activation():
while True:
time.sleep(1)
print time.time()
t = threading.Thread(name='activation', target=activation)
t.start()
我通過調用這個網頁,我的PHP頁面 :
$result = exec("c:/python27/python f:/python/hello.py");
我在PHP一個幾個按鈕,點擊該按鈕時我應該創建一個新的線程,該線程應該運行10秒。
但是當我因爲python腳本進入睡眠模式感謝名單
激活函數,有一個無限循環 – Gntem 2012-07-11 10:31:54