1 | import socket |
2 | import requests |
3 | import os |
4 | |
5 | DIR_PATH = os.path.dirname(os.path.realpath(__file__)) |
6 | |
7 | key = 2461294712 |
8 | |
9 | ip = socket.gethostbyname_ex(socket.gethostname())[-1][-1] |
10 | port = 20876701747184/key |
11 | |
12 | client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
13 | client.connect((ip, int(port))) |
14 | |
15 | def send_messages(): |
16 | while True: |
17 | text = input('Message to server: ').encode('utf-8') |
18 | if not text: |
19 | ans = input('\nDo you want to exit(y/n): ') |
20 | if ans.lower() == 'y': |
21 | client.send('EXITINGFROMCONNECTION'.encode('utf-8')) |
22 | break |
23 | else: |
24 | continue |
25 | client.send(text) |
26 | client.close() |
27 | |
28 | def main(): |
29 | pass |
30 | |
31 | if __name__ == "__main__": |
32 | main() |