0
所以,這是我的程序。當我在一個論壇上出現一個新的pm時,它會發送給我一個文本。問題是它不發送一個,它發送數百個。發送大量文字
我該如何解決這個問題?我假設一個break
陳述,但我不知道如何說出來。
import urllib2
from twilio.rest import TwilioRestClient
webp=urllib2.urlopen("http://hackforums.net").read()
words = urllib2.urlopen("http://hackforums.net").read()
word = 'titled'
while True:
for word in words:
if word in words:
ACCOUNT_SID = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXx"
AUTH_TOKEN = "XXXXXXXXXXXXXXXXXXXXXXXXXXXx"
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
message = client.sms.messages.create(to="XXXto", from_="XXXfrom",
body="You have a new PM")
然後我用:
import os
import time
while True:
os.system("python newway.py")
print 'done'
將其打開。
我有點搞砸了複製和粘貼代碼,但我認爲它仍然可讀 – user1564081 2012-07-30 22:55:25
編輯現有的問題(或刪除);沒有2個相同的問題打開。 – geoffspear 2012-07-30 22:58:27
它不會讓我編輯它,因爲我是一個新成員,但我試過 – user1564081 2012-07-30 22:59:32