dotfiles/local/bin/caesar

25 lines
400 B
Python
Executable File

#!/usr/bin/env python
from __future__ import print_function
import sys
def main(sysargs=sys.argv[:]):
d = {}
for c in (65, 97):
for i in range(26):
d[chr(i+c)] = chr((i+13) % 26 + c)
print(
"".join([
d.get(c, c) for c in " ".join(sysargs[1:])
]),
end=""
)
return 0
if __name__ == "__main__":
sys.exit(main())