Skip to content

Instantly share code, notes, and snippets.

View alpha-beta-soup's full-sized avatar
🌏
Discrete global grid systems ✨

Richard Law alpha-beta-soup

🌏
Discrete global grid systems ✨
View GitHub Profile
@mitchellrj
mitchellrj / strftime_1900.py
Created March 8, 2012 12:42
Python datetime.strftime < 1900 workaround
import datetime
import re
import warnings
def strftime(dt, fmt):
if dt.year < 1900:
# create a copy of this datetime, just in case, then set the year to
# something acceptable, then replace that year in the resulting string
tmp_dt = datetime.datetime(datetime.MAXYEAR, dt.month, dt.day,
dt.hour, dt.minute,
@geographika
geographika / arcobjects_python.py
Created April 17, 2011 11:31
ArcObjects and Python
def AppendPaths(paths):
"""Append all the paths with DLLs to be used by the script to the Python Path"""
import sys
for p in paths:
sys.path.append(p)
def AddReferences(refs):
"""Add references to the required DLLs"""
import clr