A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
#include <Python.h> // Must be first | |
#include <vector> | |
#include <stdexcept> | |
#include "PyUtils.h" | |
using namespace std; | |
// ===== | |
// LISTS | |
// ===== |
import arcpy | |
class Toolbox(object): | |
def __init__(self): | |
self.label = u'Example_Toolbox' | |
self.alias = '' | |
self.tools = [FirstTool, SecondTool, ThirdTool] | |
class FirstTool(object): |
import functools | |
import fiona | |
import geojson | |
import pyproj | |
import shapely.geometry | |
import shapely.ops | |
omit = ['SHAPE_AREA', 'SHAPE_LEN'] |
Single-line comments are started with //
. Multi-line comments are started with /*
and ended with */
.
C# uses braces ({
and }
) instead of indentation to organize code into blocks.
If a block is a single line, the braces can be omitted. For example,