zeyu2001 / pychat

A real-time Python chatroom application with Tkinter GUI

Home Page:https://dev.to/zeyu2001/build-a-chatroom-app-with-python-44fa

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pychat

A Python chatroom application with Tkinter GUI

Create Your Own Chatroom Application

Check out my tutorial here.

How to Run?

Run the server.py script from the command line.

Usage: python3 server.py <host> [-p PORT]

Arguments:

  • host: Interface the server listens at. Can be a hostname, or an IP address.
  • -p PORT: TCP port the server listens at (default 1060)

For example:

$ python3 server.py 127.0.0.1
Listening at ('127.0.0.1', 1060)
$ python3 server.py localhost
Listening at ('127.0.0.1', 1060)

Run the client.py script from the command line (in a separate terminal window).

Usage: python3 client.py <host> [-p PORT]

Arguments:

  • host: Interface the server listens at. Can be a hostname, or an IP address.
  • -p PORT: TCP port the server listens at (default 1060)

For example:

$ python3 client.py localhost
Trying to connect to localhost:1060...
Successfully connected to localhost:1060

Your name:
$ python3 client.py 127.0.0.1
Trying to connect to 127.0.0.1:1060...
Successfully connected to 127.0.0.1:1060

Your name:

Run multiple clients to chat in real-time!

Note: If connecting from a different subnet, your firewall may block the connection.

Preview

GUI Interface

Screenshot2

Command Line Interface

Screenshot1

About

A real-time Python chatroom application with Tkinter GUI

https://dev.to/zeyu2001/build-a-chatroom-app-with-python-44fa

License:MIT License


Languages

Language:Python 100.0%