Created
January 31, 2018 02:05
-
-
Save vakenbolt/a32f8f461f4f395c3534b5326cad0776 to your computer and use it in GitHub Desktop.
decode - command line string decoder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
# -*- coding: utf-8 -*- | |
import sys | |
from os import isatty | |
if isatty(sys.stdin.fileno()): | |
sys.stdout.write("""decode - command line string decoder [version 1.0] | |
Usage: [stdin...] | decode | |
To decode a string that has been copied to the clipboard. | |
pbpaste | decode | |
To decode content from a file | |
cat <file_name> | decode | |
Made with ♥ in Chicago @TheRocketWagon | |
""") | |
quit() | |
else: | |
for line in sys.stdin: | |
sys.stdout.write(line.decode('string_escape')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment