cherrypy

CherryPy is a very nice webpage framework for Python

Server.py

This is a basic server

import cherrypy
import os
from component import FindPathWebEngine
from pprint import pprint

# if you have a config, import it here
# from myproj import config
HERE = os.path.dirname(os.path.abspath(__file__))

def get_app_config():
    rv = {'/static': {
        'tools.staticdir.on': True,
        'tools.staticdir.dir': os.path.join(HERE, 'static')
    }
        ,
        '/': {'tools.sessions.on': True,
              'tools.staticdir.root': os.path.abspath(os.getcwd())
              }
    }
    pprint(rv)
    return rv

def get_app(config=None):
    config = get_app_config()
    cherrypy.tree.mount(FindPathWebEngine(), '/', config=config)
    return cherrypy.tree

if __name__ == '__main__':
    cherrypy.quickstart(FindPathWebEngine(), '/', get_app_config())
    ```


#FindPathWebEngine

This is the WebPage that will be displayed and acted on

```python
import cherrypy
class FindPathWebEngine(object):

    def __init__(self):
        print("Init being called")


    @cherrypy.expose
    def index(self):
        return """
<html><head>Find Tv</head><body>
<form action="action" method="POST">
Numbers to check:<br>
<textarea name="message" rows="10" cols="30"></textarea></br><input type="submit"/>
<p>This will search the text items you have entered/p>
</form></body></html>
"""

    @cherrypy.expose
    def action(self,message):
        return "<p>"+message+"</p>"

Running

python server.py

Then open your WebBrowser at http://127.0.0.1:8080