Browse Source

Init

master
Tu Quyen Tran Ngoc 4 years ago
commit
6f52a291bb
4 changed files with 31 additions and 0 deletions
  1. 13
    0
      clie_file.py
  2. 0
    0
      my_first_python.py
  3. 15
    0
      serv_file.py
  4. 3
    0
      venv/pyvenv.cfg

+ 13
- 0
clie_file.py View File

@@ -0,0 +1,13 @@
import socket

eingabe = input("Bitte etwas eingeben: ")

s = socket.socket()
host = socket.gethostname()
port = 12345

s.connect((host, port))

s.send(eingabe.encode('utf-8'))

s.close()

+ 0
- 0
my_first_python.py View File


+ 15
- 0
serv_file.py View File

@@ -0,0 +1,15 @@
import socket

s = socket.socket()
host = socket.gethostname()
port = 12345
s.bind((host, port))
s.listen()

while True:
(connection, addr) = s.accept()

bytes = s.recv(1024)
print(bytes.decode('utf-8'))

connection.close()

+ 3
- 0
venv/pyvenv.cfg View File

@@ -0,0 +1,3 @@
home = /usr/local/bin
include-system-site-packages = false
version = 3.7.0

Loading…
Cancel
Save