mercredi 5 août 2015

Handling user interaction in Python backends

Is there a convenient pattern or package for handling user interaction with backend code in a way which can work with different frontend options?

For instance, say I want a python package to wait for user to provide a trigger (à la "Press any key to continue), this should be implemented in one of the following ways by the frontend (the frontend being a separate module or package or program or what have you) :

  • In the shell, wait for a key press.
  • In a gui, provide a button that says "continue".
  • In a web interface, provide a button that says "continue".

What would the code within the common library look like?

Aucun commentaire:

Enregistrer un commentaire