SHARE
TWEET

Untitled

a guest Oct 21st, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from string import ascii_letters as s
  2.  
  3. import click
  4.  
  5.  
  6. @click.command()
  7. @click.option('--dec', is_flag=True)
  8. @click.argument('filename', nargs=1)
  9. @click.argument('key', nargs=1)
  10. def cli(dec, filename, key):
  11.     with open(filename, 'r') as text:
  12.         table = str.maketrans(key, s) if dec else str.maketrans(s, key)
  13.         click.echo(text.read().translate(table))
  14.  
  15.  
  16. if __name__ == "__main__":
  17.     cli()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top