Skip to main content

import this library to use chat from client to server directly

Project description

( " client-server socket chat" )

Quick start

Installing

To install the library to your bot, run the command:

pip install bizchat

To install the repository, run the command:

Usage

Basic Usage

.. code:: py

from socket import* import socket

def server():

hostname = socket.gethostname()
local_ip = socket.gethostbyname(hostname)
print(hostname, local_ip)
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
address = input("enter address :  ")
port = int(input("Enter Port : "))
server.bind((address, port))
server.listen()
print("server listening...")
connection, address = server.accept()
print("connected to client...")

while True:
    data = input("server : ")
    connection.send(bytes(data, 'utf-8'))
    recdata = connection.recv(1024).decode()
    print('client : ', recdata)

def client(): client = socket.socket() address = input("enter address : ") port = int(input("Enter Port : ")) client.connect((address, port)) print("connected to server..")

while True:
    recdata = client.recv(1024).decode()
    print('server : ', recdata)
    data = input("client: ")
    client.send(bytes(data, 'utf-8'))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bizchat-6.2.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file bizchat-6.2.0-py3-none-any.whl.

File metadata

  • Download URL: bizchat-6.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9

File hashes

Hashes for bizchat-6.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0dbcf43ee73adf0f83ec97ec40d00cc22e442dde1a7e934a04d2a5cde45d7ae2
MD5 e44afeb7fc8e148f85824782fe82313d
BLAKE2b-256 a42036b37e459299924087484aeb42f8d510898b2661e2e46b90c8d31d69aeaf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page