diff options
author | TinWoodman92 <chrhodgden@gmail.com> | 2023-06-11 20:49:16 -0500 |
---|---|---|
committer | TinWoodman92 <chrhodgden@gmail.com> | 2023-06-11 20:49:16 -0500 |
commit | 48fbc07e1106f217e56dba99d273946d39de5974 (patch) | |
tree | 617c1b82b45d0031c67cc3a7ec29136fc0494320 /source_file.py | |
parent | 2a1a16a22e44ae35b8fab3ac462b49d3be87d01f (diff) |
Updated launcher and script to use the dialoguer package.
Diffstat (limited to 'source_file.py')
-rw-r--r-- | source_file.py | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/source_file.py b/source_file.py deleted file mode 100644 index 672139c..0000000 --- a/source_file.py +++ /dev/null @@ -1,41 +0,0 @@ -import socket - -HEADER = 64 -PORT = 6011 -SERVER = 'localhost' -ADDR = (SERVER, PORT) -FORMAT = 'utf-8' -DISCONNECT_MESSAGE = b'!DISSCONNECT' - -CONN = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -CONN.connect(ADDR) - -def display_msg(msg): - print( - '\033[93m', - msg, - sep='', - end='\033[0m\n' - ) - -def send_msg(conn, msg): - data = bytes(msg, FORMAT) - data += b' ' * (HEADER - len(data)) - conn.send(data) - -def recv_msg(conn): - msg = conn.recv(HEADER).strip() - msg = msg.decode(FORMAT) - return msg - -msg = "Initializing Client - Python" -display_msg(msg) - -msg = "Initialized Client - Python" -send_msg(CONN, msg) - -while msg != '!DISCONNECT': - msg = recv_msg(CONN) - display_msg(msg) - -CONN.close()
\ No newline at end of file |