2017-01-12 24 views
-1
while True: 
    now = datetime.datetime.now() 
    if now.weekday() == 5: 
     if now.hour() == 10 and now.minute() == 30: 
      webbrowser.open(url) 
    elif now.hour() == 7 and now.minute == 0: 
     webbrowser.open(url) 
    time.sleep(1) 
+2

'now.minute'和'now.hour'不是函數刪除這些調用的括號。 –

+0

沒有工作,但仍然感謝! –

回答

0

hourminute沒有方法,你不需要給他們打電話。

if now.weekday() == 5: 
    if now.hour == 10 and now.minute == 30: 
     webbrowser.open(url) 
elif now.hour == 7 and now.minute == 0: 
    webbrowser.open(url) 
相關問題