私信  •  关注

Felipe Ferri

Felipe Ferri 最近创建的主题
Felipe Ferri 最近回复了
6 年前
回复了 Felipe Ferri 创建的主题 » 如何在python中使用变量作为属性

您错过了将实际算法名称传递给 getattr 打电话来。

试试这个:

getattr(hashlib, 'md5')(bytes(guess)).hexdigest()