You have got many thing wrong with your code. I will just mention and explain the issues
print("Welcome to randomprogram.....to enter please provide Username and Password")
def main():
a = open('C:/Users/josep/Documents/randomprogram(acc).txt','r')
b = a.readlines(1)
c = a.readlines(2)
c = [a.strip() for a in c]
print(c)
d = input("Username:")
e = input("Password:")
f = (d + e)
print(f)
if f == c:
g = a.readlines(1)
g = [a.strip() for a in g]
print("Welcome to randomprogram" + f)
else:
print("Wrong Username and/or Password.....try again")
main()
main()
My suggestion will be read all lines as are doing and the put all the line in proper variables; example:
a=open(fname,'r')
(programName, userpassword)=[f.strip() for f in a.readlines()]
print(programName);
print(userpassword);
*
seek — Python Reference (The Right Way) 0.1 documentation[
^]