[英]Python ValueError: not enough values to unpack (expected 3, got 1)
i tried writing this code but had an error.我尝试编写此代码,但出现错误。 used windows 10 and python 3.8.5
使用 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)
Error:错误:
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)
I dont really get what's off.我真的不明白发生了什么。 please help me by correcting this code.
请通过更正此代码来帮助我。 and if possible tell me why this happens
如果可能的话,告诉我为什么会这样
is it a problem with tuples or what pls help with this这是元组的问题还是有什么帮助
argv
actually return a list whose first element (ie index 0 element) is the location of the python file. argv
实际上返回一个列表,其第一个元素(即索引 0 元素)是 python 文件的位置。 To correct this error, use script, combo_file, ex_file = argv[1:]
要更正此错误,请使用
script, combo_file, ex_file = argv[1:]
Alternatively, you can also use _, script, combo_file, ex_file = argv
或者,您也可以使用
_, script, combo_file, ex_file = argv
Relevant Documentation - https://docs.python.org/3/library/sys.html相关文档 - https://docs.python.org/3/library/sys.html
(Tested on Windows 10 (64 Bit) Python 3.7.4) (在 Windows 10(64 位)Python 3.7.4 上测试)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.