vanessa
This commit is contained in:
parent
a98ee559f3
commit
03bc287bd3
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
12
client.py
Normal file
12
client.py
Normal file
@ -0,0 +1,12 @@
|
||||
import socket
|
||||
s = socket.socket()
|
||||
host = socket.gethostname()
|
||||
port = 2345
|
||||
|
||||
|
||||
s.connect((host,port))
|
||||
msg = input(' ')
|
||||
byte = s.send(msg.encode('utf-8'))
|
||||
recievemsg = s.recv(1024)
|
||||
print(recievemsg.decode('utf-8'))
|
||||
s.close()
|
19
server.py
Normal file
19
server.py
Normal file
@ -0,0 +1,19 @@
|
||||
import socket
|
||||
|
||||
s = socket.socket ()
|
||||
host = socket.gethostname()
|
||||
port = 2345
|
||||
s.bind((host,port))
|
||||
s.listen()
|
||||
|
||||
while True:
|
||||
(connection , addr) = s.accept()
|
||||
print('verbindung von ',addr)
|
||||
#msg = 'Danke für das vorbeischauen!'
|
||||
bytes = connection.recv(1024)
|
||||
#msg = baba
|
||||
msg =bytes.decode('utf-8')
|
||||
#test = msg.upper()
|
||||
connection.send(msg.upper().encode('utf-8'))
|
||||
connection.close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user