2012-08-29 35 views
0

我想通过无线网络使用bottle.py。不幸的是我不知道如何去设置它。我想通过无线网络执行的代码(从另一台计算机执行)是:通过无线网络使用Bottle.py

import ctypes 
from bottle import get, post, request, run 

@get('/control') 
def message(): 
    return '''<form method='POST' action='/control'> 
     <input name='message' type='text'/> 
     <input type='submit'/> 
     </form>''' 

@post('/control') 
def send(): 
    Message =request.forms.get('message') 
    MessageBox = ctypes.windll.user32.MessageBoxA 
    MessageBox(None,Message,'MESSAGE', 0) 

run(host=127.0.0.1, port=8090) 
+0

我已经将缩进调整为实际意义。你可以编辑自己的帖子,如果你能改进它,那么我鼓励你这样做。 –

+0

它现在不会杀死我的眼睛,谢谢James :) – tmg

回答

1

并回答问题 - 您确定只想绑定它@ 127吗?我的意思是 - 127.0 ...是本地主机...尝试0.0.0.0或IP