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
import urllib2 | |
import string | |
from BeautifulSoup import BeautifulSoup | |
#from bs4 import BeautifulSoup # if using BeautifulSoup4 | |
name_out = '/path/to/Desktop/words.csv' | |
the_file_out = open(name_out, 'w') | |
for alpha in list(string.ascii_lowercase): # ['a','b','c']: # |
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 -*- | |
""" | |
Note: | |
In numpy, every "append" action requires re-allocation of the array memory | |
and short-term doubling of memory requirements. So, the more general | |
solution is to allocate arrays to be as large as the final output of your | |
algorithm. | |
""" | |
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
""" | |
Uses the glyphicons.css file from http://glyphicons.com | |
To use: | |
python hex_from_glyphicons.py name | |
or: | |
python hex_from_glyphicons.py -all | |
""" | |
import sys |
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 -*- | |
""" | |
Generate a value that occurs within a periodic cycle. | |
@author: dhohls@csir.co.za | |
""" | |
import numpy as np | |
import random |
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
""" | |
Simple Web socket client implementation using Tornado framework. | |
Adapted from: | |
http://code.activestate.com/recipes/579076-simple-web-socket-client-\ | |
implementation-using-torn/ | |
Usage Example: | |
# stream messages to console | |
python websocket_client.py -s 127.0.0.1:9090/websocket |
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
""" | |
Purpose: Generate a colour swathe from colours in an image | |
Author: D Hohls | |
Date: 2016/08/16 | |
Requires: | |
pip install pillow | |
Usage: | |
python swathe.py -i IMAGE_IN.PNG -o IMAGE_OUT.PNG | |
If output (-o) not supplied, name will default to IMAGE_IN_swathe.PNG |
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
# -*- coding: utf-8 -*- | |
""" | |
Purpose: Convert .NET ticks to formatted ISO8601 time | |
Author: D Hohls < dhohls@csir.co.za> | |
""" | |
from __future__ import print_function | |
import datetime | |
import sys | |
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
# -*- coding: utf-8 -*- | |
""" | |
Created on: Mon Oct 31 2016 | |
Author: Derek Hohls | |
Purpose: generate management buzzphrases from buzzwords | |
BUZZ_WORDS are from http://bollocksphere.co.uk/Content/generationtable.shtml | |
""" | |
import random |
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
# -*- coding: utf-8 -*- | |
""" | |
Purpose: Demo of basic PyWPS JSON functionality (requires PyWPS v4.0.x) | |
Created: 10-01-2017 | |
Author: dhohls@csir.co.za | |
Adapted from: | |
https://github.com/geopython/pywps-demo/blob/master/demo.py | |
""" | |
import json |
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
# -*- coding: utf-8 -*- | |
""" Purpose: Demonstrate use of Python's basic log operations | |
Created: 2017-09-01 | |
Contact: dhohls@csir.co.za | |
Usages:: | |
python logging_demo.py | |
python logging_demo.py -ll=ERROR |
OlderNewer