简体   繁体   English

通过无线网络使用Bottle.py

[英]Use Bottle.py over a wireless network

I want to use bottle.py over a wireless network. 我想通过无线网络使用bottle.py Unfortunately I do not know how to go about setting this up. 不幸的是,我不知道如何进行设置。 The code I want to execute over a wireless network (Execute from another computer) is: 我要通过无线网络执行的代码(从另一台计算机执行)是:

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)

And to answer question - are you sure you want to bind it only @ 127? 并回答问题-您确定仅在127处绑定它吗? What I mean - 127.0... is localhost... try 0.0.0.0 or the IP 我的意思是-127.0 ...是localhost ...请尝试0.0.0.0或IP

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM