好吧我正在編程一種方式來與Grooveshark接口(http://grooveshark.com)。現在我有一個類Grooveshark和幾個方法,一個獲得與服務器的會話,另一個獲取基於會話的令牌,另一個用於構建對服務器的API調用(以及其他使用該方法的方法)。現在,我用它像這樣....注意,即使第一要不然初始化,你必須調用兩個方法的類的其它方法後使用扭曲和tidefer在扭曲 g = Groo
我有下面的代碼: for f in fileListProtocol.files:
if f['filetype'] == '-':
filename = os.path.join(directory['filename'], f['filename'])
print 'Downloading %s...' % (filename)
newFile =
在命令提示i型>> twistd來echobot.tac運行 Traceback (most recent call last):
File "C:\Python26\Scripts\twistd.py", line 18, in ?
from twisted.scripts.twistd import run
ImportError: No module named twi
我有一個客戶端連接到使用扭曲的服務器。客戶端有一個線程可能在後臺做事。當反應堆關閉,我必須: 1) check if the thread is doing things
2) stop it if it is
什麼是一個優雅的方式來做到這一點?我能做的最好的是有些糊塗事,如: def cleanup(self):
isWorkingDF = defer.Deferred()