()
| 12 | |
| 13 | |
| 14 | def main(): |
| 15 | print('''L3375P34]< (leetspeek) |
| 16 | By Al Sweigart al@inventwithpython.com |
| 17 | |
| 18 | Enter your leet message:''') |
| 19 | english = input('> ') |
| 20 | print() |
| 21 | leetspeak = englishToLeetspeak(english) |
| 22 | print(leetspeak) |
| 23 | |
| 24 | try: |
| 25 | # Trying to use pyperclip will raise a NameError exception if |
| 26 | # it wasn't imported: |
| 27 | pyperclip.copy(leetspeak) |
| 28 | print('(Copied leetspeak to clipboard.)') |
| 29 | except NameError: |
| 30 | pass # Do nothing if pyperclip wasn't installed. |
| 31 | |
| 32 | |
| 33 | def englishToLeetspeak(message): |
no test coverage detected