Skip to main content

Cmd2 extension for async programs

Project description

Async extension to a famous Cmd2 library.

Cmd2 permanently occupies the main thread which is a problem if you plan to receive callbacks on the main thread (e.g., by Bluetooth stack Bleak)

Pip installation

BoolTest is available via pip:

pip3 install ph4-acmd2

Local installation

From the local dir:

pip3 install --upgrade --find-links=. .

Usage

import asyncio
import ph4acmd2

class CmdLineApp(ph4acmd2.Cmd):
    async def main(self):
        await self.acmdloop()
        print("Cmdloop finished now")

if __name__ == '__main__':
    app = CmdLineApp()
    loop = asyncio.get_event_loop()
    loop.set_debug(True)
    loop.run_until_complete(app.main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ph4-acmd2-0.0.2.tar.gz (4.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page