listPkt
[234, 0, 1, 2, 3, 235, 0, 1, 2, 3, 119, 136, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99]
pkt = bytes(listPkt)
pkt
b'\xea\x00\x01\x02\x03\xeb\x00\x01\x02\x03w\x88\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abc'
hd.sendpacket(pkt)
Traceback (most recent call last):
File "<pyshell#59>", line 1, in
hd.sendpacket(pkt)
File "C:\Python39\lib\site-packages\pcap_pcap.py", line 312, in sendpacket
if _pcap.sendpacket(self.__pcap, buf, len(buf)) == -1:
ctypes.ArgumentError: argument 2: <class 'TypeError'>: expected LP_c_ubyte instance instead of bytes
How to use the function 'sendpacket' ?
the following error info is “<class 'TypeError'> expected LP_c_ubyte instance instead of bytes”, how to use the function ? thanks a lot