hello
This commit is contained in:
commit
c0ec1db1a4
8
client.py
Normal file
8
client.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import socket
|
||||||
|
s= socket.socket()
|
||||||
|
host=socket.gethostname()
|
||||||
|
port= 12345
|
||||||
|
s.connect((host , port))
|
||||||
|
bytes= s.recv(1024)
|
||||||
|
print(bytes.decode("utf-8") )
|
||||||
|
s.closed()
|
12
sever.py
Normal file
12
sever.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import socket
|
||||||
|
s = socket.socket()
|
||||||
|
host = socket.gethostname()
|
||||||
|
port = 12345
|
||||||
|
s.bind((host , port))
|
||||||
|
s.listen()
|
||||||
|
while True:
|
||||||
|
(connection.addr )= s.accept()
|
||||||
|
print("verbindung von", addr)
|
||||||
|
msg= "Danke für das vorbeischauen!"
|
||||||
|
connection.send(msg.encode("utf-8"))
|
||||||
|
connection.close()
|
Loading…
x
Reference in New Issue
Block a user