索引器列表索引输出Python 3

2024-06-26 14:59:18 发布

您现在位置:Python中文网/ 问答频道 /正文

您好,我正在制作脚本,但不断出现错误弹出:

File "creditcardsniff.py", line 70, in findCreditCard
    print(f"{GREEN}{BRIGHT}[+] Found American Express Card: " + str(americaRE[0]) +""+ str(CCVRE[0]) +""+ str(MMYY[0]))
IndexError: list index out of range

我有两个人试图通过重写正则表达式来帮助我解决这个问题,这是我们能想到的唯一解决办法。我们看到scapy只发现mmyy为空,但检测到其他所有内容(卡和ccv) 以下是我使用的正则表达式格式(如果有帮助):

 MMYY = re.findall("(0[1-9]|10|11|12)\/[0-9]{2}", raw)

如果你需要更多信息,让我知道我也在使用python 3.8


Tags: inpy脚本错误linegreenfileprint