Python ValueError:没有足够的值可解包(预期3,得到1)

Legend_recalls

我尝试编写此代码,但出现错误。使用Windows 10和python 3.8.5

#usage
#python3 coex.py combo.txt extracted.txt

from sys import argv
import re

script , combo_file , ex_file = argv

cfile = open(combo_file)
xfile = open(ex_file, 'w')
def rexmail(cfile):
    rexmail = re.compile(r'[a-zA-Z0-9_.+-]+@[a-zA-Z0-9.-]+:[a-zA-Z0-9._-]+')
    cfile = rexmail.findall(cfile.read())
    
    lenofclist = len(cfile)
    for i in range(lenofclist):
        xfile.write("\n")
        xfile.write(str(cfile[i]))
        
    print("[+]*********EXTRACTING DONE***********[+]\n")
    print("[+]*********CHECK extracted.txt FILE FOR EMAIL:PASS COMBOS*************[+]\n")




def header():
    print('''
            made with <3

 _______           ___    ___      _________        ________          ________          ________          _________        ________          ________     
|\  ___ \         |\  \  /  /|    |\___   ___\     |\   __  \        |\   __  \        |\   ____\        |\___   ___\     |\   __  \        |\   __  \    
\ \   __/|        \ \  \/  / /    \|___ \  \_|     \ \  \|\  \       \ \  \|\  \       \ \  \___|        \|___ \  \_|     \ \  \|\  \       \ \  \|\  \   
 \ \  \_|/__       \ \    / /          \ \  \       \ \   _  _\       \ \   __  \       \ \  \                \ \  \       \ \  \\\  \       \ \   _  _\  
  \ \  \_|\ \       /     \/            \ \  \       \ \  \\  \|       \ \  \ \  \       \ \  \____            \ \  \       \ \  \\\  \       \ \  \\  \| 
   \ \_______\     /  /\   \             \ \__\       \ \__\\ _\        \ \__\ \__\       \ \_______\           \ \__\       \ \_______\       \ \__\\ _\ 
    \|_______|    /__/ /\ __\             \|__|        \|__|\|__|        \|__|\|__|        \|_______|            \|__|        \|_______|        \|__|\|__|
                  |__|/ \|__|                                                                                                                             
                                                                                                       EMAIL:PASS extractor from any txt file .                                                   
                                                                                                                                                          

''')


header()

rexmail(cfile)

错误:

Traceback (most recent call last):
  File "C:\Users\BRS\Desktop\minecraft\Combo-Extractor-master\coex.py", line 8, in <module>
    script , combo_file , ex_file = argv
ValueError: not enough values to unpack (expected 3, got 1)

我真的没有得到什么。请通过更正此代码来帮助我。并告诉我为什么会这样

元组有问题吗?请问有什么帮助

安维特

argv实际上返回一个列表,其第一个元素(即索引0元素)是python文件的位置。要更正此错误,请使用script, combo_file, ex_file = argv[1:]
或者,您也可以使用_, script, combo_file, ex_file = argv

相关文档-https: //docs.python.org/3/library/sys.html

(在Windows 10(64位)Python 3.7.4上测试)

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

ValueError:没有足够的值可解包(预期2,得到1)NetworkX python 3

Python 3-ValueError:没有足够的值可解包(预期3,得到2)

Python ValueError:没有足够的值可解包(预期3,得到2)

如何修复ValueError:没有足够的值在python中解包(预期为2,得到1)?

Python OpenCV 中的 ValueError - 没有足够的值来解包(预期 3,得到 2)

如何修复 ValueError:没有足够的值在 Python 中解压(预期为 3,得到 1)?

ValueError:尝试解包python中的dict以对熊猫进行数据标记时,没有足够的值要解包(预期2,得到1)

如何修复 Python 错误:没有足够的值来解包(预期 2,得到 1)

python3:没有足够的值来解包(预期为 2,得到 0)

python的棉花糖给出ValueError:没有足够的值要解压(预期2,得到1)

Python-如何解决“ ValueError:没有足够的值要解压(预期2,得到1)”

如何修复 ValueError:没有足够的值在 python 中解压(预期 3,得到 2)

ValueError:没有足够的值可解包(预期11,得到1)

ValueError:没有足够的值可解包(预期为4,得到1)

想要找到轮廓-> ValueError:没有足够的值可解包(预期3,得到2),出现

cv.findContours()-ValueError:没有足够的值可解包(预期3,得到2)

ValueError:没有足够的值可解包(预期为4,得到3)

Python 3:我有问题:ValueError:没有足够的值在一个非常简单的脚本中解压(预期为 2,得到 0):

ValueError:没有足够的值可解包(预期2,得到1)但我提供2个值

ValueError:没有足够的值来解包(预期为 1,得到 0)

ValueError:没有足够的值来解包(预期为 8,得到 1)

ValueError:在字典上没有足够的值来解包(预期 4,得到 1)

ValueError:启动 celery worker 时没有足够的值来解包(预期为 3,得到 0)

Pyinstaller Kivy 应用程序 ValueError:没有足够的值来解包(预期 3,得到 2)

ValueError:没有足够的值来解包(预期 3,得到 2)(OpenCV)

ValueError:没有足够的值来解包(预期为 2,得到 1)使我无法完成我的代码

nm, address = addr ValueError: 没有足够的值来解包(预期为 2,得到 1),Django Rest Framework

Django ValueError-没有足够的值可解压(预期2,得到1)

ValueError:解包的值太多(预期 3)列出 Python