Skip to content

Improve the way script waits for printer #11

Open
@javl

Description

The way this script works is that we send a message to the printer, and receive a response in a listener function, which then triggers sending the next message to the printer.

Problem here is that Python thinks we're done as soon as we've send our message, and exists the script. To prevent this I've added an ugly hack by calling sleep(60), which keeps our script running for at least a minute. During this time the listener is still active and can respond to messages from the printer.

It would be great if we could somehow get rid of this hack and implement a better way of making sure we're done before exiting.

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions