Hi all,
is it possible to import socket python module in a skulpt AI2 project? I tried to redesign the pitagoras skulpt example for other purposes using socket module but it doesn't work (doesn't recognize socket module).
This is the python script I want to write in skulpt AI2 project:
import socket
client_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
port = 15327 ***
minutes = 10 ***
num_packets = int(minutes) * 60 * 50 #packetization ***
print("num_packets:",num_packets)
message = b'test'
addr = ("10.x.x.x", int(port))
client_socket.sendto(str(num_packets).encode(), addr)
conta = num_packets
while True:
*** try:
*** data, server = client_socket.recvfrom(4096)
*** print("Packet#",str(conta))
*** conta -= 1***
*** if not data or not conta:***
*** quit()***
*** except:***
*** print('End of transfer')***
*** quit()***
Thanks!
Luis.