Tkinter is python's de-factor standard GUI (Graphical User Interface) package. While it may not be as feature-rich as other libraries like PyQt or wxPython , its simplicity and ease of use make it an ideal choice for beginners. In this post, we'll focus on implementing ELSA, a chat application with a graphical user interface.
ELSA (Emulated Learning and Speech Assistant) is a python-based chat application with a graphical user-interface (GUI) built using tkinter. It allows users to interact with a chatbot that can respond to predefined questions, provide current date and time, display images, and optionally convert text responses to speech using pyttsx3.
Tech Stack
Python 3.x
Tkinter
-
Pillow
( PIL ) pyttsx3
Interaction
- Type your messages in the entry field and press Enter or click Send.
- Use commands like
hi
,date
,time
,clear
andbye
for specific responses. - Typing
pic
will display a random image from the img folder. -
Text-to-Speech - Click the Text to Speech button to toggle speech synthesis ON or OFF.
- Note: Speech synthesis requires speakers or headphones connected to hear the output.
- Clear Chat - Click Clear Chat to erase all messages from the chat window.
JSON Dataset
The chatbot's responses are based on a predefined set of questions and answers stored in knowledge_base.json file.
Conclusion
Implementing ELSA was a fun and interactive experience that taught me the basics of GUI programming with tkinter.
GitHub
Check it out here: https://github.com/vanu888/GUI-Bot.git
Top comments (0)