Skip to Content
Tkinter GUI Programming by Example
book

Tkinter GUI Programming by Example

by David Love
April 2018
Beginner content levelBeginner
340 pages
7h 54m
English
Packt Publishing
Content preview from Tkinter GUI Programming by Example

Adding the new endpoints to our Requester

When the user opens  up a chat window with a friend, our Requester will need to contact the web server to retrieve the conversation history. If there is no conversation history to be obtained, then we will want to initialize the database to prevent errors.

Since initializing the database when it already exists will do nothing, we are safe to call the endpoint even if a database already exists.

We can take advantage of this in our Requester, so that we can skip adding a separate method for initialization and, instead, handle it all when getting the history:

def prepare_conversation(self, user_one, user_two):    endpoint = "/create_conversation_db" params = {"user_one": user_one, "user_two": user_two} ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Tkinter GUI Application Development Blueprints, Second Edition - Second Edition

Tkinter GUI Application Development Blueprints, Second Edition - Second Edition

Bhaskar Chaudhary

Publisher Resources

ISBN: 9781788627481Supplemental Content