Click here to Skip to main content
15,920,111 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
This is what I want to do:

if usernamebox is in "usernames.txt" and passwordbox is in "passwords.txt"

usernames.txt includes a number of usernames
and the same for passwords.txt

What I have tried:

if usernamebox.get() is in ("usernames.txt") and passwordbox.get() is in ("passwords.txt")
Posted
Updated 21-Jan-18 16:29pm
Comments
Richard Deeming 23-Jan-18 13:25pm    
So someone can log in as any user in your system, so long as they know the password for at least one account?

1 solution

So what you need to do is google "how to read files in python".

Google[^]

File Handling Cheat Sheet in Python[^]

Reading and Writing Files in Python[^]

Now break your problem down into smaller pieces so you don't feel overwhelmed. So figure out to read usernames.txt and loop over each line (examples provided in links above). Then use your string contains code to decide what to do within the loop over file lines.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900