Speeding up python CLI's!
so yesterday I was trying to make a python CLI that needed to be fast.

no matter what I did (`python -S`, pyinstaller, cx_freeze, bytecode compiling) it wouldnt be as fast as I needed it and some even made it slower like cx_freeze.

well I found a way to make running it much much faster (nearly instantaneous).

by using an asynchronous socket server and using netcat as input, you can give input to the server and recieve output immediately, since the script is already running

it works for windows and linux, but you may need cygwin on windows unless there is a built in timeout and netcat command I do not know about

how it works (on linux) is you define a bash function with this:
`hithere(){ printf "$@" | timeout 0.1 nc 127.0.0.1 50200; }`

and run the script: 
`python pyspeedtest.py`

to send input you run `hithere Mum` and you get `hi, Mum`

pyspeedtest.py
```
import pyspeed

class myhandler(pyspeed.pyspeed_handler):
    def handle_request(self, *argv):
        return f"hi, {argv[1]}"

handle = myhandler()
handle.run()
```

pyspeed.py
```python
import asyncio, socket

class pyspeed_handler:
    async def run_server(self, address, port, handle):
        server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        server.bind((address, port))
        server.listen(8)
        server.setblocking(False)
        loop = asyncio.get_event_loop()
        while True:
            client, _ = await loop.sock_accept(server)
            loop.create_task(handle(client))
    async def handle_client(self, client):
        loop = asyncio.get_event_loop()
        request = None
        try:
            while request != 'quit':
                request = (await loop.sock_recv(client, 255)).decode('utf8')
                response = self.handle_request(*([''] + str(request).split(' '))) + '\n'
                await loop.sock_sendall(client, response.encode('utf8'))
            client.close()
        except BrokenPipeError:
            pass
    def handle_request(self, *argv):
        return ''.join(argv)
    def run(self, address="localhost", port=50200):
        asyncio.run(self.run_server(address, port, self.handle_client))
```
```