nos0s/groundwork/client.py

14 lines
406 B
Python
Raw Normal View History

2023-03-21 21:52:27 +00:00
import config_loader
import socket
import log
class Client:
def __init__(self):
self.config = config_loader.get_config()
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((self.config['server']['host'], self.config['server']['port']))
s.sendall(b'Hello world')
data = s.recv(1024)
log.error(f'> Received {data!r}')