A simple chat room application built with Python, featuring both command-line and GUI interfaces. The application uses socket programming for network communication and PyQt5 for the graphical user interface.
- Real-time chat messaging
- Multiple client support
- Both GUI and command-line interfaces
- Simple and intuitive user interface
- Message broadcasting to all connected clients
Before running the application, make sure you have Python 3.x installed and the following dependencies:
pip install PyQt5pyChatRoom/
├── server.py # Chat server implementation
├── client.py # Command-line client
├── client_gui.py # GUI client implementation
└── README.md # This file
- Open a terminal in the project directory
- Run the server:
python server.pyThe server will start listening on localhost:8888
- Open a new terminal
- Launch the GUI client:
python client_gui.py- Enter your name when prompted
- Start chatting!
- Open a new terminal
- Launch the command-line client:
python client.py- Enter your name when prompted
- Type messages and press Enter to send
- Type 'q' to quit
- Handles multiple client connections using threading
- Broadcasts messages to all connected clients
- Manages client disconnections gracefully
- Modern PyQt5-based interface
- Real-time message updates
- Clean disconnection handling
- Message input with both Enter key and Send button support
- Scrollable chat history
- Simple text-based interface
- Lightweight implementation
- Suitable for basic testing and development
The application uses:
- Socket programming for network communication
- Threading for handling multiple clients
- Message length headers for reliable message transmission
- PyQt5 for the graphical user interface
- QThread for non-blocking message reception in GUI
-
Port Already in Use
- Ensure no other instance of the server is running
- Change the port number in both server and client files
-
Connection Refused
- Make sure the server is running before starting clients
- Verify the host and port settings
Feel free to fork this project and submit pull requests. You can also open issues for bugs or feature requests.
This project is open source and available under the MIT License.