Skip to content

This is a custom python messaging program/application where users can communicate with each other over a localhost server

Notifications You must be signed in to change notification settings

08mfp/Python-Messaging-Program-V2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Messaging Program

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.

Running Program

*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

Table of Contents

File Structure

.
├── Client
│   ├── client.py
│   └── userGUI.py
├── Server
│   ├── baseServer.py
│   ├── mainServerHub.py
│   ├── serverGUI.py
│   ├── serverInit.py
├── README.md
└── runServer.py
└── extraClients.py

Requirements

  • Python 3.x
  • customtkinter library

Setup Instructions

Step 1: Navigate to the Root Directory

Open your terminal and navigate to the root directory of the project.

Step 2: Create a Virtual Environment

On macOS:

python3 -m venv venv
source venv/bin/activate

On Windows:

python -m venv venv
venv\Scripts\activate

Step 3: Install customtkinter

With your virtual environment activated, install the required library:

pip install customtkinter

Running the Program

To Run the Server and the First Messaging Client

  1. Ensure your virtual environment is activated (refer to Step 2).

  2. Run the following command to start the server and the first client:

    python3 runServer.py

To Run Additional Clients

  1. Ensure your virtual environment is activated (refer to Step 2).

  2. Open a new terminal window in the root directory.

  3. Run the following command to start an additional client:

    python3 extraClients.py

Features

Server

  • Listens for client connections and handles messages.
  • Provides hooks for handling events such as connection, disconnection, and message reception.
  • Supports multiple clients simultaneously.

Client

  • 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.

Available Commands

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.

About

This is a custom python messaging program/application where users can communicate with each other over a localhost server

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages