Hello world

The heart of a kervi application is the Application class. You must create an Application instance as the very first operation in your main application script.

Create a python file my_app.py with the content below.

if __name__ == '__main__': # this line is important in windows
    from kervi.application import Application

    app = Application()

When you run the python script in a terminal you should see the following output.

>python3 my_app.py
Starting kervi application
IPC address: tcp://
loaded plugin: kervi.plugin.storage.sqlite_temp
loaded plugin: kervi.plugin.storage.sqlite
platform driver: kervi.platforms.windows
load interprocess communication
start websocket: 9000
Listining for discovery requests on port: 9434
:green:`Your Kervi application is ready at`
Press ctrl + c to stop your application

That is a lot of output for two lines of code. The Application class prepares your application upon instantiation. It figures out if you are using a platform like Raspberry Pi and loads required drivers and plugins.

The important line is “Your application is ready at”. Open a browser and go to that address


Not the most inspiring application but now you are started. Proceed to the next chapter and see how you add some content.