我正在玩Scapy,我想在Python脚本中使用它,但发送数据包似乎是一个问题.这是我的代码.
Scapy Shell:
send(IP(src="10.0.99.100",dst="10.1.99.100")/ICMP()/"Hello World")
Run Code Online (Sandbox Code Playgroud)
这工作正常并发送数据包.
Python脚本:
#! /usr/bin/env python
from scapy.all import sr1,IP,ICMP
p=sr1(IP(src="10.0.99.100",dst="10.1.99.100")/ICMP()/"Hello World")
Run Code Online (Sandbox Code Playgroud)
运行正常,但当它尝试发送数据包时,我得到:
WARNING: No route found for IPv6 destination :: (no default route?)
Begin emission:
.Finished to send 1 packets.
....^C
Received 5 packets, got 0 answers, remaining 1 packets
Run Code Online (Sandbox Code Playgroud) 我试图让我的 Tkinter 程序从标准 .gif 加载和显示 .jpgs 文件
import Image,ImageTk
root = Tk()
PILFile = Image.open("Image.jpg")
Image = PhotoImage(file=PILFile)
ImageLabel = Label(root,image=Image)
ImageLabel.image = Image
ImageLabel.pack()
root.mainloop()
Run Code Online (Sandbox Code Playgroud)
我收到的错误消息如下:
import Image,ImageTk
root = Tk()
PILFile = Image.open("Image.jpg")
Image = PhotoImage(file=PILFile)
ImageLabel = Label(root,image=Image)
ImageLabel.image = Image
ImageLabel.pack()
root.mainloop()
Run Code Online (Sandbox Code Playgroud)
我绝对确定该文件以正确的格式存在,我可能做错了什么?