O'Reilly logo

Tkinter GUI Programming by Example by David Love

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the Conversation class in our server

To integrate the Conversation class with our flask server, we need to create some endpoints that will call its methods. Since the Conversation class needs a database passed in, we will also have to deduce which database we are writing to in our endpoints.

The following naming conventions will be used for our databases:

  • Take the username of the author
  • Take the username of the person receiving the message
  • Arrange them alphabetically
  • Join them with an underscore
  • Add .db as the file extension

When we name our database as such, we will only have one database per two people conversing. Arranging the names alphabetically when determining the database to use ensures that it doesn't matter which user opens ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required