File: util.py

package info (click to toggle)
prjtrellis 1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 83,000 kB
  • sloc: cpp: 20,813; python: 16,246; sh: 375; makefile: 262; asm: 80; ansic: 58
file content (8 lines) | stat: -rw-r--r-- 293 bytes parent folder | download
1
2
3
4
5
6
7
8
# Useful functions for constructing nets.
def char_range(c1, c2):
    """Generates the characters from `c1` to `c2`, exclusive."""
    for c in range(ord(c1), ord(c2)):
        yield chr(c)

def net_product(net_list, range_iter):
    return [n.format(i) for i in range_iter for n in net_list]