Skip to content

Instantly share code, notes, and snippets.

@judy2k
Created March 26, 2019 11:13
Show Gist options
  • Save judy2k/de8a2fe5ef18954e79b96b0e5abaf0e3 to your computer and use it in GitHub Desktop.
Save judy2k/de8a2fe5ef18954e79b96b0e5abaf0e3 to your computer and use it in GitHub Desktop.
trim - a useful (but tiny) script to trim surrounding whitespace from some output.
#!/usr/bin/env python3
import sys
def main():
i = sys.stdin.read()
sys.stdout.write(i.strip())
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment