Posts by Diego Cândido • 23 points
4 posts
-
1
votes2
answers38
viewsQ: How to add an iframe via JS?
I’m trying to add a simple iframe to an html page, but it’s not working: var ifrm = document.createElement("iframe"); ifrm.setAttribute("src", "http://www.google.com/");…
-
0
votes1
answer1193
viewsQ: How to send images via socket in Python?
So is the server: import socket from PIL import Image port = 8000 host = '127.0.0.1' s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((host, port)) s.listen(5) while True: conn, addr =…
-
0
votes1
answer92
viewsA: How to make more than one type of request to the Python server?
I did it that way, but it doesn’t work: dado, adress = sock.recvfrom(3000) while True: if dado.decode('ascii') == 'Buscar': data, adress = sock.recvfrom(4000) if data.decode('ascii') in dicty:…
-
0
votes1
answer92
viewsQ: How to make more than one type of request to the Python server?
I separated using a function, but the code does not receive the 'date'. COMPLETE SERVER CODE: import socket import json import sys dicty = { 'the': 'o, a, os, as', 'hello': 'ola', 'hi': 'oi',…