Update client.py
This commit is contained in:
13
client.py
13
client.py
@@ -97,16 +97,23 @@ while not current_user:
|
|||||||
clear()
|
clear()
|
||||||
w, _ = term_size()
|
w, _ = term_size()
|
||||||
print(blauw_bg + wit + "Terminal Chat ".center(w) + reset)
|
print(blauw_bg + wit + "Terminal Chat ".center(w) + reset)
|
||||||
|
|
||||||
|
print( groen + "========================================")
|
||||||
|
print("Welkom bij De Terminal Chat")
|
||||||
|
print("========================================" + reset)
|
||||||
|
print()
|
||||||
print_white("1. inloggen")
|
print_white("1. inloggen")
|
||||||
print_white("2. nieuw account")
|
print_white("2. nieuw account")
|
||||||
|
print()
|
||||||
keuze = input(wit + " > " + reset)
|
keuze = input(wit + " > " + reset)
|
||||||
|
print()
|
||||||
if keuze == "1":
|
if keuze == "1":
|
||||||
current_user = login()
|
current_user = login()
|
||||||
elif keuze == "2":
|
elif keuze == "2":
|
||||||
signup()
|
signup()
|
||||||
|
|
||||||
host = "192.168.254.36"
|
host = "127.0.0.1"
|
||||||
port = 44703
|
port = 44705
|
||||||
try:
|
try:
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
s.connect((host, port))
|
s.connect((host, port))
|
||||||
@@ -221,7 +228,7 @@ def chat_session(chatkeuze):
|
|||||||
}).encode("utf-8"))
|
}).encode("utf-8"))
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
print_white("Beschikbare chats:")
|
print_white(" --- Beschikbare chats: --- ")
|
||||||
for i, chat in enumerate(chat_names, start=1):
|
for i, chat in enumerate(chat_names, start=1):
|
||||||
print_white(f"{i}. {chat}")
|
print_white(f"{i}. {chat}")
|
||||||
print_white(f"{len(chat_names)+1}. Nieuwe chat aanmaken")
|
print_white(f"{len(chat_names)+1}. Nieuwe chat aanmaken")
|
||||||
|
|||||||
Reference in New Issue
Block a user