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 ctypes | |
import ctypes.wintypes | |
class Constants(object): | |
"Container for constants found in win32 headers" | |
WS_OVERLAPPED = 0x00000000L | |
WS_POPUP = 0x80000000L | |
WS_CHILD = 0x40000000L | |
WS_MINIMIZE = 0x20000000L | |
WS_VISIBLE = 0x10000000L |
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
def rows_as_dicts(cursor): | |
colnames = cursor.fields | |
for row in cursor: | |
yield dict(zip(colnames, row)) | |
with arcpy.da.SearchCursor(r'c:\data\world.gdb\world_cities', '*') as sc: | |
for row in rows_as_dicts(sc): | |
print row['CITY_NAME'] |
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 collections | |
def rows_as_namedtuples(cursor): | |
col_tuple = collections.namedtuple('Row', cursor.fields) | |
for row in cursor: | |
yield col_tuple(*row) | |
with arcpy.da.SearchCursor(r'c:\data\world.gdb\world_cities', '*') as sc: | |
for row in rows_as_namedtuples(sc): | |
print sc.CITY_NAME |
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
def rows_as_update_dicts(cursor): | |
colnames = cursor.fields | |
for row in cursor: | |
row_object = dict(zip(colnames, row)) | |
yield row_object | |
cursor.updateRow([row_object[colname] for colname in colnames]) | |
with arcpy.da.UpdateCursor(r'c:\data\world.gdb\world_cities', ['CITY_NAME']) as sc: | |
for row in rows_as_update_dicts(sc): | |
row['CITY_NAME'] = row['CITY_NAME'].title() |
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
['ArgImagePlugin', | |
'BaseHTTPServer', | |
'Bastion', | |
'BdfFontFile', | |
'BmpImagePlugin', | |
'BufrStubImagePlugin', | |
'CGIHTTPServer', | |
'Canvas', | |
'ConfigParser', | |
'ContainerIO', |
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 ctypes | |
import ctypes.wintypes | |
import os | |
import threading | |
import Queue | |
import uuid | |
__all__ = ['NotificationIcon'] | |
# Create popup menu |
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 os | |
import re | |
import zipfile | |
current_path = os.path.dirname(os.path.abspath(__file__)) | |
out_zip_name = os.path.join(current_path, | |
os.path.basename(current_path) + ".esriaddin") | |
BACKUP_FILE_PATTERN = re.compile(".*_addin_[0-9]+[.]py$", re.IGNORECASE) |
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
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab | |
set backspace=indent,eol,start | |
set guifont=Consolas:h10:cDEFAULT | |
set ruler | |
colorscheme zenburn | |
syntax on | |
filetype indent plugin on | |
set directory+=$HOME |
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
def join_string(fn): | |
def fn_(*a, **k): | |
return "".join(reversed(list(fn(*a, **k)))) | |
return fn_ | |
@join_string | |
def binary_string(number, bit_count): | |
for bit in xrange(bit_count): | |
yield "1" if number & 1 == 1 else "0" | |
number = number >> 1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer