Browse Source

Added tiny test script

Timo Dritschler 3 years ago
parent
commit
24e8bcb97f
1 changed files with 26 additions and 0 deletions
  1. 26 0
      test.py

+ 26 - 0
test.py

@@ -0,0 +1,26 @@
+#!/usr/bin/python
+import socket
+import sys
+
+host = "localhost"
+port = 56000
+
+with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
+    s.connect((host, port))
+
+    s1 = None
+    s2 = None
+
+    if sys.version[0] == "2": 
+        s1 = char(42)
+        s2 = char(255)
+    else:
+        s1 = bytes([42])
+        s2 = bytes([255])
+
+
+    s.sendall(s1)
+    s.sendall(s2)
+
+
+print("Done")