Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
長時間実行されるプロセスへのWebインターフェイス用のクライアントがあります。そのプロセスからの出力を表示してもらいたいのですが。でうまく機能しますが、パラメータurllib.urlopen()がありません。timeout一方urllib2.urlopen()、出力はバッファリングされます。そのバッファを無効にする簡単な方法はありますか?
urllib.urlopen()
timeout
urllib2.urlopen()
私に起こった簡単なハックは、タイムアウトをエミュレートするためにを使用urllib.urlopen()することです。threading.Timer()しかし、それは迅速で汚いハックにすぎません。
threading.Timer()