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 | |
__doc__ = "A small command line utility taking one argument--a text file--counts the words and prints the number." | |
import os, sys | |
if len(sys.argv) == 2: | |
with open(os.path.abspath(sys.argv[1])) as f: | |
text = f.read() |
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/local/env python | |
#-*- coding: utf-8 -*- | |
""" | |
Argparse Testing Utilities | |
========================== | |
Because we want some random strings suitable for testing the | |
input and output of :func:argparse.parser(). | |
Why? I keep slightly modifying my argparse options, and I want |
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/env python | |
#-*- coding: utf-8 -*- | |
""" | |
Local Weather TextExpander Snippet | |
================================== | |
Quickly enter local weather conditions, specifically current temp | |
in www.dailymile.com workouts. This is useful for tracking | |
performance against temperature more closely than dailymile.com | |
currently allows with their pictures. |
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
""" | |
A simple python script to read setup.cfg and install our requirements | |
Why? Replace pip -r requirements in CI/CD or Docker environments. | |
""" | |
# using pip._internal.main | |
# https://stackoverflow.com/questions/12937533/use-pip-install-uninstall-inside-a-python-script |