Run your app

Admit you've got an app:

from guy import Guy

class YourApp(Guy):
    ...

if __name__ == "__main__":
    app=YourApp()
    app.run()           #<- this is how to run it ;-)

Info

Since 0.5.1 versions, you can use autoreload's mode to help you during dev process (in production : don't set the autoreload to True)

The differents modes

Each method starts the loop (and provide the GUI). And when exiting : returns the main instance. (can be useful to get back some attributs setted during the GUI loop)

app mode

Use app.run()

Classical mode, on desktop : it uses the installed chrome browser in app mode. (it's the way to run on android too)

Optionnal parameters:

  • log: (bool) enable logging (client & server side) (don't have any effect on android), default: False
  • autoreload: (bool) autoreload on changes (don't have any effect on android), default: False

cef mode

Use app.runCef()

Special mode for desktop : when you want to provide a standalone app, with all included. You will need cefpython3 !

Optionnal parameters:

  • log: (bool) enable logging (client & server side), default: False
  • autoreload: (bool) autoreload on changes, default: False

server mode

Use app.serve()

Server mode, for servers.

Optionnal parameters:

  • log: (bool) enable logging (client & server side), default: False
  • port: (number) listening port, default: 8000.
  • open: (bool) open default browser to the client, default: True
  • autoreload: (bool) autoreload on changes, default: False

To summarize the choice

Just a table to help you to select the best mode for your needs

Mode : App Cef Server
Your users need chrome to run your app yes no no
Works on android/apk yes no no
Works on any OS yes yes yes
Your script is freezable, on any OS yes yes yes
Your script is pip packageable yes yes yes
Minimum size of the freezed executable 6mo 60mo 6mo
Many clients at same time no no yes
Host your app on a server (glitch.com) no no yes

Info

Pip-packageable is only enabled for guy >= 0.4.0