This is a simple, temporary chat app built using Python and Tkinter. It supports sending messages in real time between two users. Additionally, the app allows users to set a background image and change it dynamically.
- Real-time Chat: Communicate with another user in real time.
- Customizable Background: Users can set and change the background image.
- Standalone Executable: Package the app into an executable so others can run it without needing Python.
- Python 3.x installed on your machine.
- PyInstaller (for creating standalone executables).
chat_app/
│
├── server.py # The server code (handles connections)
├── client.py # The client code (with GUI)
├── assets/ # Folder to store background images
│ └── background.jpg # Default background image
└── README.md # This file with instructions
-
Install Python:
- Download and install Python 3 from python.org.
-
Install PyInstaller:
- Open a terminal or command prompt and install PyInstaller using pip:
pip install pyinstaller
- Open a terminal or command prompt and install PyInstaller using pip:
-
Navigate to the project folder:
- Open a terminal (or command prompt) and go to the folder where the
server.py
script is located:cd /path/to/chat_app
- Open a terminal (or command prompt) and go to the folder where the
-
Run the server script:
- Start the server using Python:
python server.py
The server will start and listen for connections at
127.0.0.1:5000
. - Start the server using Python:
-
Navigate to the project folder:
- Open a new terminal and go to the folder where
client.py
is located:cd /path/to/chat_app
- Open a new terminal and go to the folder where
-
Run the client script:
- Start the client using Python:
python client.py
- Start the client using Python:
-
The client GUI will open, allowing you to chat in real-time. You and your girlfriend can both run this on separate machines if you're connected to the same network.
If you don’t want others to install Python, you can package the app into standalone executables using PyInstaller.
-
Navigate to the folder containing
client.py
:cd /path/to/chat_app
-
Run PyInstaller to package the client as an executable:
pyinstaller --onefile --windowed client.py
--onefile
: Bundles everything into a single executable.--windowed
: Ensures the terminal window does not pop up when running the GUI (only applies to GUI apps).
-
The executable will be placed in the
dist/
folder asclient.exe
(on Windows) orclient
(on Mac/Linux). -
Send the Executable: Send the
client.exe
orclient
file to your girlfriend (or any other user). They can just double-click the file to start the chat app without installing Python.
You can also package the server script as an executable if you'd like to make it easier for you to run it.
-
Package the server:
pyinstaller --onefile server.py
The server executable will be located in the
dist/
folder asserver.exe
(on Windows) orserver
(on Mac/Linux).
- Place your background image in the
assets/
folder. - Run the client, and you will see the default background.
- To change the background, click the "Change Background" button in the app, and select a new image from your file system.
Feel free to fork this project and make contributions! If you find any bugs or want to add more features, open a pull request.
This project is open-source and available under the MIT License.