2024-10-02 22:28:11 发布
网友
我在github上发现了以下代码:https://github.com/Abrand88/Reddit-Tor-proxy-voting-bot/blob/master/reddit_proxy_voting_bot.py
我知道这是一个机器人和潜在的恶意,但我认为它很酷。从教育的角度看,我如何让它发挥作用?:当我运行程序时,它输出“socket:”两次,然后给出错误“KeyError:'127.0.0.1'”
有什么想法吗?你知道吗
它正在使用字典,找不到本地主机的密钥。你知道吗
这可能导致错误中断:
ip_hash={}; # the dictionary is made
以及
ip_hash[ip] = 1; # the dictionary is incorrectly accessed
光是这一部分不是个好主意:
if ip in ip_hash: print " repeat " + ip; else: ip_hash[ip] = 1;
它正在使用字典,找不到本地主机的密钥。你知道吗
这可能导致错误中断:
以及
光是这一部分不是个好主意:
相关问题 更多 >
编程相关推荐