PTT
Submit
Submit
選擇語言
正體中文
简体中文
PTT
Python
Re: [問題] socketio & thread
作者:
gn00618777
(非常念舊)
2015-05-17 11:54:59
※ 引述《gn00618777 (非常念舊)》之銘言:
: 我在 flask 框架下使用 sokcetio,以下是草略架構
: server.py:
: from flask import Flask
: from threadin import Thread
: app = Flask(__name__)
: socketio = SocketIO(app)
: def background_thread():
: while True:
: ...
: ...
: @app.route('/')
: def index():
: thread = Thread(target=background_thread)
: tread.start()
: return render_template('receiver.html')
: @socketio.on('connect',namespace='/test')
作者:
gn00618777
(非常念舊)
2015-05-17 12:08:00
OK,測試結果還是有增加,所以 thread 還是沒有結束沒錯,只是有沒有辦法直接 kill thread 的方法
作者:
dritchie
(卍~邁斯納效應~卍)
2015-05-17 21:57:00
Python 原生不提供 terminate thread 的方法
作者:
eight0
(欸XD)
2015-05-18 12:30:00
http://x.co/9SsXc
可以 stop/pause/resume,參考看看
作者:
gn00618777
(非常念舊)
2015-05-18 16:16:00
感謝
繼續閱讀
[問題] socketio & thread
gn00618777
[問題] 關於pygame與Wiiuse的溝通問題
jeok70
[閒聊] PyCon 徵票
loyo
[問題] 中文編碼錯誤
aiweisen
[問題] os.symlink
gozule
[情報] PyCon APAC 夜市攤位徵求中
Strong
[問題] telnet 自動登入並重開機
shiyeh
[問題] opencv 3.0 beta python
ppp0978
Re: [問題] python 安裝套件問題
Neisseria
[問題] python 安裝套件問題
mastoid
Links
booklink
Contact Us: admin [ a t ] ucptt.com