dotfiles/config/scripts/lestrte

29 lines
541 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
# maj = True
for line in sys.stdin:
nl = ""
word = ""
grace = True
for c in line:
if c.isalpha():
if grace:
nl += word
nl += c
word = ""
grace = False
else:
word += c
else:
wrd = list(word)
random.shuffle(wrd)
2021-06-13 11:49:21 +02:00
nl += "".join(wrd)
2021-06-11 21:42:55 +02:00
nl += c
word = ""
grace = True
print(nl, end="")