Python Forum
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
py7h0n -> python
#1
Hi there,

I am looking for an easy way to recognize special characters in a word as normal characters (as in the description)!

another example would be p@$sw0rd -> password.

Are there any libraries already available for this?
Reply
#2
for start have a look at string.translate() and string.maketrans()
you will need to create the translation table yourself.
Reply
#3
you can try 
https://github.com/floft/leetspeak

It seems to work with basic and advanced leet speak. It only got the one password one wrong
metulburr@ubuntu:~/Downloads/leetspeak-master$ python3 leet.py "d1c710n4ry"
dictionary
metulburr@ubuntu:~/Downloads/leetspeak-master$ python3 leet.py "p@$sw0rd"
pa
metulburr@ubuntu:~/Downloads/leetspeak-master$ python3 leet.py "py7h0n"
python
metulburr@ubuntu:~/Downloads/leetspeak-master$ python3 leet.py "5h4k35p34r3"
shakespeare
metulburr@ubuntu:~/Downloads/leetspeak-master$ python3 leet.py "/\\/\\374|_"
metal
metulburr@ubuntu:~/Downloads/leetspeak-master$ python3 leet.py "|\\/|3+41"
metal
metulburr@ubuntu:~/Downloads/leetspeak-master$ python3 leet.py "py7h0n 15 7h3 b357 pr06r4mm1n6 l4n6u463"
python is the best programming language
Recommended Tutorials:
Reply
#4
Actually *you* got it wrong, just try echo "p@$sw0rd" in your command prompt and guess what happened :)
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply
#5
do this command first, to fix it: sw0rd='''s$w0rd'''
or just use single quotes in a unix shell

it is not like python, and triple quotes only sorta work for the wrong reason (why did they work on the command given above?)
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020