Python 3.4: Unknown format code 'x'

試著忘記壹切 提交于 2019-12-02 08:06:47

While trying to reproduce, your code seems to work exactly as expected. I do not see any shebang-line. Are you sure you are executing using python3?

Sample output from # python3.4 snif2.py:

Ethernet Frame:
Destination: A4:17:31:xx:xx:xx, Source: 00:0C:F6:xx:xx:xx, Protocol: 8

Ethernet Frame:
Destination: 00:0C:F6:xx:xx:xx, Source: A4:17:31:xx:xx:xx, Protocol: 8
^CTraceback (most recent call last):
  File "snif2.py", line 27, in <module>
    main()
  File "snif2.py", line 9, in main
    raw_data, addr = conn.recvfrom(65536)
KeyboardInterrupt
farghali

Update your Python to version 3.6.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!