我在我的文本文件中循環列出了一個問題。我錯過了一些東西,但我不知道它是什麼。這裏是我的腳本循環功能有問題
user = open ('users.txt' , 'r')
password = open ('password.txt' , 'r')
# username = user.readline()
password_list = password.readline()
pa = ''.join(password_list)
for users in user:
for pass_list in pa:
login_data = users + pass_list
print login_data
這就是我得到了我的輸出
[email protected]
P
[email protected]
a
[email protected]
s
[email protected]
s
[email protected]
w
[email protected]
o
[email protected]
r
[email protected]
d
[email protected]
1
[email protected]
[email protected]
P
[email protected]
a
[email protected]
s
[email protected]
s
[email protected]
w
[email protected]
o
[email protected]
r
[email protected]
d
[email protected]
1
[email protected]
我想什麼,看看它的打印是
[email protected]
Password1
[email protected]
Password1
etc .........
我想你的意思是寫'password_list = password.readlines()'(不'readline') –
這也是超級迷惑地擁有像'用戶在user:'和'pass_list在pa:'這樣的行,列表的名字看起來應該是列表中的項目名稱,反之亦然 – StephenTG