This Python Messaging Program allows multiple clients to connect to a central server and exchange messages using a set of predefined commands. The program is built using Python and features a graphical user interface (GUI) created with customtkinter
.
*there was an issue where the number of users were not correvtly updated, this was due to starting the program incorrectly and has since been resolved
.
├── Client
│ ├── client.py
│ └── userGUI.py
├── Server
│ ├── baseServer.py
│ ├── mainServerHub.py
│ ├── serverGUI.py
│ ├── serverInit.py
├── README.md
└── runServer.py
└── extraClients.py
- Python 3.x
customtkinter
library
Open your terminal and navigate to the root directory of the project.
python3 -m venv venv
source venv/bin/activate
python -m venv venv
venv\Scripts\activate
With your virtual environment activated, install the required library:
pip install customtkinter
-
Ensure your virtual environment is activated (refer to Step 2).
-
Run the following command to start the server and the first client:
python3 runServer.py
-
Ensure your virtual environment is activated (refer to Step 2).
-
Open a new terminal window in the root directory.
-
Run the following command to start an additional client:
python3 extraClients.py
- Listens for client connections and handles messages.
- Provides hooks for handling events such as connection, disconnection, and message reception.
- Supports multiple clients simultaneously.
- Connects to the server and communicates using a set of predefined commands.
- Allows private messaging, group messaging, and broadcasting messages to all connected clients.
- Supports changing the username and retrieving the list of connected users.
Clients can use the following commands to interact with the server and other users:
- /DISCONNECT: Disconnect from the server.
- /HELP: Display a list of available commands.
- /USERS: List all currently connected users.
- /PM : Send a private message to a specific user.
- /GROUPMESSAGE <username1, username2, ...>: Send a message to a group of users.
- /SENDALL: Send a message to all users (including the server).
- /CHANGEUSERNAME <new_username>: Change your username.