Created
September 15, 2011 14:12
-
-
Save weakdancer/1219336 to your computer and use it in GitHub Desktop.
threading problem fdbfischer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fdbfischer | |
import threading | |
import sys | |
import time | |
_fdb=fdbfischer.fdb(4) | |
_fdb.test() | |
_i=_fdb.input | |
_o=_fdb.output | |
_index=file('static/index.html',"r").read() | |
from flask import Flask | |
from flask import request | |
app = Flask(__name__) | |
@app.route("/") | |
def index(): | |
return _index | |
@app.route("/output",methods=['POST', 'GET']) | |
def doget(): | |
_o(int(request.args.get("board_num","")),int(request.args.get("output_num","")),request.args.get("state","")) | |
return '''board_controll_char = %s'''%repr(_fdb.get_board_controll_char()) | |
def run_server(): | |
app.run(host='192.168.1.104',port=80) | |
e=threading.Thread(target=run_server) | |
e.start() | |
tk=threading.Thread(target=_fdb.tk.mainloop) | |
tk.start() | |
d=threading.Thread(target=_fdb.run) | |
d.start() | |
_handle_redraw=threading.Thread(target=_fdb._handle_redraw) | |
_handle_redraw.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment