开发者

How do I interface python progam with the web

开发者 https://www.devze.com 2023-02-15 05:47 出处:网络
I have a python program and need to run that program in the background and get the out开发者_Go百科put in the browser .we are using a plug-in for this purpose and I found that only html and Java scrip

I have a python program and need to run that program in the background and get the out开发者_Go百科put in the browser .we are using a plug-in for this purpose and I found that only html and Java script can be run in chrome extension.


Are you trying to build a web application? If so, web.py is my personal favorite. It's very lightweight and easy to use.

Here's an entire web application -- albeit a trivial one.

import web

urls = (
    '/(.*)', 'hello'
)
app = web.application(urls, globals())

class hello:        
    def GET(self, name):
        if not name: 
            name = 'World'
        return 'Hello, ' + name + '!'

if __name__ == "__main__":
    app.run()
0

精彩评论

暂无评论...
验证码 换一张
取 消