Send packet python -


how in python? this.

packetbuffer[0] := $00; packetbuffer[1] := $12; packetbuffer[2] := $12; 'sendpacket(processid, @packetbuffer, true, false);' 

use socket module:

import socket s = socket.socket(socket.af_inet, socket.sock_stream) s.connect((your_host, your_port)) msg_to_send = 'whatever' num_sent = 0 while num_sent < len(msg_to_send):     sent = s.send(msg_to_send[num_sent:])     if sent == 0:         raise runtimeerror("socket connection broken")     num_sent += sent 

Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Socket.connect doesn't throw exception in Android -

SPSS keyboard combination alters encoding -