Ejemplo n.º 1
0
from ex7.Client0 import Client
from Client import Client1
from Seq1 import Seq

PRACTICE = 2
EXERCISE = 7
print(f"-----| Practice {PRACTICE}, Exercise {EXERCISE} |------")
IP = "127.0.0.1"
PORT = 8080
c = Client(IP, PORT)
PRACTICE = 2
EXERCISE = 6
print(f"-----| Practice {PRACTICE}, Exercise {EXERCISE} |------")

c1 = Client1(IP, 8081)
s = Seq()
s.read_fasta("P2/Sequences/PRAT1.txt")
print(f"Gene FRAT1: {s}")
count = 0
i = 0
while i < len(s.strbases) and count < 10:
    print(f"Fragment {count + 1} : {s.strbases[i:i + 10]}")
    count += 1
    i += 1
    if count % 2 != 0:
        print(c.talk(f"Fragment {count} : {s.strbases[i:i + 10]}"))
    elif count % 2 == 0:
        print(c1.talk(f"Fragment {count} : {s.strbases[i:i + 10]}"))
    else:
        break
Ejemplo n.º 2
0
from ex7.Client0 import Client
from termcolor import colored
PRACTICE = 2
EXERCISE = 4
print(f"-----| Practice {PRACTICE}, Exercise {EXERCISE} |------")
IP = "127.0.0.1"
PORT = 8081
c = Client(IP, PORT)
print(c.debug_talk(colored(
    "Message 1: First connection",
    "blue",
)))
print(c.debug_talk(colored(
    "Message 2: Testing !!!",
    "blue",
)))
Ejemplo n.º 3
0
from ex7.Client0 import Client
from termcolor import colored
PRACTICE = 2
EXERCISE = 3
print(f"-----| Practice {PRACTICE}, Exercise {EXERCISE} |------")
IP = "127.0.0.1"
PORT = 8080
c = Client(IP, PORT)
response = c.talk(colored("This is something random", "yellow", ))
print("Response: " + response)
Ejemplo n.º 4
0
from ex7.Client0 import Client

from Seq1 import Seq
PRACTICE = 2
EXERCISE = 6
print(f"-----| Practice {PRACTICE}, Exercise {EXERCISE} |------")
IP = "127.0.0.1"
PORT = 8080
c = Client(IP, PORT)

s = Seq()
s.read_fasta("P2/Sequences/PRAT1.txt")
print(f"Gene FRAT1: {s}")
count = 0
for i in range(0, len(s.strbases), 10):
    print(f"Fragment {count + 1} : {s.strbases[i:i+10]}")
    print(c.talk(s.strbases[i:i + 10]))
    count += 1
    if count == 5:
        break
Ejemplo n.º 5
0
from ex7.Client0 import Client
from pathlib import Path
PRACTICE = 2
EXERCISE = 5
print(f"-----| Practice {PRACTICE}, Exercise {EXERCISE} |------")
IP = "127.0.0.1"
PORT = 8080
c = Client(IP, PORT)

print(c.talk(Path("P2/Sequences/U5.txt").read_text()))
Ejemplo n.º 6
0
from ex7.Client0 import Client
PRACTICE = 2
EXERCISE = 1
print(f"-----| Practice {PRACTICE}, Exercise {EXERCISE} |------")
IP = "127.0.0.1"
PORT = 8080
c = Client(IP, PORT)
print(c)
Ejemplo n.º 7
0
from ex7.Client0 import Client

PRACTICE = 2
EXERCISE = 1

print(f"-----| Practice {PRACTICE}, Exercise {EXERCISE} |------")


IP = "127.0.0.1"
PORT = 8080


c = Client(IP, PORT)

c.ping()

c.advanced_ping()