dotfiles/config/scripts/lestrte

22 lines
435 B
Plaintext
Raw Normal View History

2021-06-13 11:49:21 +02:00
#!/usr/bin/env python3
2021-06-11 21:42:55 +02:00
import sys
import random
for line in sys.stdin:
nl = ""
word = ""
for c in line:
if c.isalpha():
word += c
2021-06-11 21:42:55 +02:00
else:
if len(word) > 2:
wrd = list(word)[1:]
random.shuffle(wrd)
nl += word[0] + "".join(wrd)
else:
nl += word
2021-06-11 21:42:55 +02:00
word = ""
nl += c
2021-06-11 21:42:55 +02:00
print(nl, end="")