probemon
probemon copied to clipboard
Fixed the error: type object 'datetime.datetime' has no attribute 'da…
Running probemon.py on Raspberry pi3 with Kali Linux as OS getting error:
root@kali:~# python probemon.py -i wlan1
Traceback (most recent call last):
File "probemon.py", line 99, in <module>
main()
File "probemon.py", line 96, in main
sniff(iface=args.interface, prn=built_packet_cb, store=0)
File "/usr/lib/python2.7/dist-packages/scapy/sendrecv.py", line 620, in sniff
r = prn(p)
File "probemon.py", line 37, in packet_callback
log_time = datetime.datetime.now().isoformat()
AttributeError: type object 'datetime.datetime' has no attribute 'datetime'`
Error has been resolved by the suggested changes.
you changed the import from "import datetime" to "from datetime import datetime" and you made the error yourself. this fix is not wrong but also not necessary.
Shouldn't it just be "log_time = datetime.now().isoformat()" instead of "log_time = datetime.datetime.now().isoformat()" that is the edit I had to make to avoid this error.
Shouldn't it just be "log_time = datetime.now().isoformat()" instead of "log_time = datetime.datetime.now().isoformat()" that is the edit I had to make to avoid this error.
How can I find the log_time ? so that then I can edit it ?