Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import socket
from sympy import * # noqa
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('zerois-o-reiwa.seccon.jp', 23615))
x = symbols('x')
while True:
number = s.recv(2048)
print('number is', number)
formula = s.recv(2048).decode('utf-8')
formula = formula.replace('?', 'x')
formula = formula[2:-2]
print(formula)
send = str(solve(formula, x))[1:-1] + '\n'
if send == '\n':
send = '0\n'
print(send)
s.sendall(str(send).encode('utf-8'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.