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 | |
import json | |
import sys | |
def pp(vv, prefix='$'): # vv = array w/ JSON data, prefix = what's printed at the start of each line | |
if isinstance(vv, (list,tuple)): # if vv is a list/tuple - an Array in Ruby | |
for i, v in enumerate(vv): # vv being enumerated means each array element | |
# is being given an "index", so (a, b, c) => [(0, a), (1, b), (2, c)]... | |
# so for each "index" & "value" pair of the enumerated vv array... |