-1
我正在嘗試使用scapy編寫nslookup
的代碼。當我運行它時,它說:Ether對象不可調用-python
TypeError: 'Ether' object is not callable
它指向此行:print(ans(ether(ip.src)))
。
有人可以告訴我如何解決這個問題嗎?
我正在嘗試使用scapy編寫nslookup
的代碼。當我運行它時,它說:Ether對象不可調用-python
TypeError: 'Ether' object is not callable
它指向此行:print(ans(ether(ip.src)))
。
有人可以告訴我如何解決這個問題嗎?
您的Scapy語法已關閉。它應該是
print(ans[IP].src)
,而不是
print(ans(ether(ip.src)))
我沒有看到以太部分如何有什麼與此有關。在編寫nslookup時,我認爲你有與我不同的方法。
你是否搜索了你得到的錯誤? – tburrows13
我做過了,但找不到具體的答案,我正在尋找 – Jane
您可以顯示代碼嗎?看起來像以太對象已經實例化,並且在他的類中沒有__call__方法 –