Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Problems accessing text file to create a password guessing game

$
0
0

I'm using python and a text file with the top 12,000 most common passwords. It's a game for educational purposes where the program needs to be able to access the text file to then check if it's the correct password.

It might be a problem with accessing the top 12,000 passwords file, but heres the code:

import stringimport ospassword = "martin"line = 1file = open(r"bots\passwords.txt")while line > 12000:    pw = file.readline(line)    if pw == password:        break

Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>