I am new to python, and a friend of mine has given me this code. I have searched up \b and \r and figured out that they’re end-of-word character and return, respectively. However, I have typed it exactly as a is, even copied on text editor, but it still says hat I failed. So, how exactly is a supposed to be typed?
#!/usr/bin/env python
a = "password \b\b\b\b\b " + "\b\b\b " + "\b\r "
b = "123456789"
c = "qwertyuiooo"
d = "sdfghjkl;"
e = "zxcvbnm,."
b = raw_input("Password: ")
if b == a:
print("Correct")
else:
print "YOUR A FAILURE!!!"
As Martijn Pieters points out, most terminals won’t send the
\bcharacter when you type backspace. So entering the password with the keyboard is not possible.However, the keyboard is not your only option for entering data. You can also pipe in data from another file. Create a file which contains the password,
\band all:Then use
<to pipe your password file into your friend’s script.