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
""" | |
Wrapper call to os.path.join and os.path.expanduser that checks whether the | |
returned path is of a given type. | |
Author: awan1 | |
Date: 20151029 | |
""" | |
import os |
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
""" | |
Allows choice of options via command line. | |
Author: awan1 | |
Date: 20151029 | |
""" | |
import numpy as np | |
def ask_user_for_selection(choices, choice_text='options'): |
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
########### | |
## Notes ## | |
########### | |
## This shows you how to configure your ls command to not show certain files, | |
## and tell you how many of those files were omitted. This declutters your ls output. | |
## To use this, add it to whatever .{profile, alias, rc} file you put your aliases in. | |
## The ls and find functions here are the GNU variants: the flags needed are not in | |
## the BSD variant, which is the OSX default. | |
## So on OSX, you'll need to install GNU ls and GNU find (see http://goo.gl/bDO0ga), |
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
# You'll need to `pip install html2text` | |
import urllib.request | |
import html2text | |
def get_text_from_url(url): | |
fp = urllib.request.urlopen(url) | |
url_bytes = fp.read() | |
url_str = url_bytes.decode("utf8") |