文件user_info.txt

zhangsan,123
lisi,456
wangwu,789

读取文件test24.py

user_file = open('user_info.txt','r')
lines = user_file.readlines()
user_file.close()

for line in lines:
    #print(line.split(','))
    username =line.split(',')[0]
    password =line.split(',')[1]
    print(username,password)